Knp\Bundle\KnpBundlesBundle\Features\Context\FeatureContext::assertResponseShouldContainJson PHP Method

assertResponseShouldContainJson() public method

public assertResponseShouldContainJson ( Behat\Gherkin\Node\PyStringNode $jsonString )
$jsonString Behat\Gherkin\Node\PyStringNode
    public function assertResponseShouldContainJson(PyStringNode $jsonString)
    {
        $etalon = json_decode($this->replacePlaceHolder($jsonString->getRaw()), true);
        $actual = json_decode($this->getSession()->getPage()->getContent(), true);
        if (null === $etalon) {
            throw new \RuntimeException("Can not convert etalon to json:\n" . $this->replacePlaceHolder($jsonString->getRaw()));
        }
        assertCount(count($etalon), $actual);
        $this->recursiveArrayKeysCheck($actual, $etalon);
    }