Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace PHPUnit exact match with PHP-coduo
  • Loading branch information
yoanm committed May 5, 2023
commit 7149d10b8d0c5cb3db2503d8869cda6f1ad7af9c
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"require-dev": {
"behat/behat": "^3.9.0",
"coduo/php-matcher": "^6.0",
"dvdoug/behat-code-coverage": "^5.0",
"phpspec/prophecy": "^1.15",
"phpspec/prophecy-phpunit": "^2.0",
Expand Down
7 changes: 4 additions & 3 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Behat\Behat\Context\Environment\InitializedContextEnvironment;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\PyStringNode;
use DemoApp\Dispatcher\BehatRequestLifecycleDispatcher;
use Coduo\PHPMatcher\PHPUnit\PHPMatcherAssertions;
use PHPUnit\Framework\Assert;
use Tests\Functional\BehatContext\Helper\FakeEndpointCreator;

Expand All @@ -13,6 +13,8 @@
*/
class FeatureContext extends AbstractContext
{
use PHPMatcherAssertions;

const KEY_JSON_RPC = 'jsonrpc';
const KEY_ID = 'id';
const KEY_RESULT = 'result';
Expand Down Expand Up @@ -75,8 +77,7 @@ public function thenLastResponseShouldBeAValidJsonRpcError()
*/
public function thenIShouldHaveTheFollowingResponse(PyStringNode $expectedResult)
{
// Decode content to get rid of any indentation/spacing/... issues
Assert::assertEquals(
$this->assertMatchesPattern(
$this->jsonDecode($expectedResult->getRaw()),
$this->getLastResponseDecoded()
);
Expand Down