Add integration test for attachment handling on cards

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2022-10-31 11:46:29 +01:00
parent f35a9d08e5
commit 39c59a3bd6
6 changed files with 169 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ class BoardContext implements Context {
private $stack = null;
/** @var array last card response */
private $card = null;
private array $storedCards = [];
/** @var ServerContext */
private $serverContext;
@@ -31,6 +32,15 @@ class BoardContext implements Context {
return $this->card;
}
/**
* @Given /^creates a board with example content$/
*/
public function createExampleContent() {
$this->createsABoardNamedWithColor('Example board', 'ff0000');
$this->createAStackNamed('ToDo');
$this->createACardNamed('My example card');
}
/**
* @Given /^creates a board named "([^"]*)" with color "([^"]*)"$/
*/
@@ -232,4 +242,15 @@ class BoardContext implements Context {
$this->requestContext->sendJSONrequest('POST', '/index.php/apps/deck/cards/' . $this->card['id'] .'/label/' . $label['id']);
$this->requestContext->getResponse()->getBody()->seek(0);
}
/**
* @When remember the last card as :arg1
*/
public function rememberTheLastCardAs($arg1) {
$this->storedCards[$arg1] = $this->getLastUsedCard();
}
public function getRememberedCard($arg1) {
return $this->storedCards[$arg1] ?? null;
}
}