Add test for unified comments search
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
31
tests/integration/features/bootstrap/CommentContext.php
Normal file
31
tests/integration/features/bootstrap/CommentContext.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
class CommentContext implements Context {
|
||||
use RequestTrait;
|
||||
|
||||
/** @var BoardContext */
|
||||
protected $boardContext;
|
||||
|
||||
/** @BeforeScenario */
|
||||
public function gatherContexts(BeforeScenarioScope $scope) {
|
||||
$environment = $scope->getEnvironment();
|
||||
|
||||
$this->boardContext = $environment->getContext('BoardContext');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^post a comment with content "([^"]*)" on the card$/
|
||||
*/
|
||||
public function postACommentWithContentOnTheCard($content) {
|
||||
$card = $this->boardContext->getLastUsedCard();
|
||||
$this->requestContext->sendOCSRequest('POST', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments', [
|
||||
'message' => $content,
|
||||
'parentId' => null
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user