fix: Limit card activities for deleted cards
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -17,9 +17,9 @@ class BoardContext implements Context {
|
||||
/** @var array last card response */
|
||||
private $card = null;
|
||||
private array $storedCards = [];
|
||||
private ?array $activities = null;
|
||||
|
||||
/** @var ServerContext */
|
||||
private $serverContext;
|
||||
private ServerContext $serverContext;
|
||||
|
||||
/** @BeforeScenario */
|
||||
public function gatherContexts(BeforeScenarioScope $scope) {
|
||||
@@ -285,4 +285,23 @@ class BoardContext implements Context {
|
||||
public function deleteTheBoard() {
|
||||
$this->requestContext->sendJSONrequest('DELETE', '/index.php/apps/deck/boards/' . $this->board['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Given /^get the activities for the last card$/
|
||||
*/
|
||||
public function getActivitiesForTheLastCard() {
|
||||
$card = $this->getLastUsedCard();
|
||||
$this->requestContext->sendOCSRequest('GET', '/apps/activity/api/v2/activity/filter?format=json&type=deck&since=0&object_type=deck_card&object_id=' . $card['id'] . '&limit=50');
|
||||
$this->activities = json_decode((string)$this->getResponse()->getBody(), true)['ocs']['data'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the fetched activities should have :count entries
|
||||
*/
|
||||
public function theFetchedActivitiesShouldHaveEntries($count) {
|
||||
Assert::assertEquals($count, count($this->activities ?? []));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user