{"action":"created","issue":{"url":"https://api.github.com/repos/coduo/php-matcher/issues/47","labels_url":"https://api.github.com/repos/coduo/php-matcher/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/coduo/php-matcher/issues/47/comments","events_url":"https://api.github.com/repos/coduo/php-matcher/issues/47/events","html_url":"https://github.com/coduo/php-matcher/issues/47","id":54556820,"number":47,"title":"Using @string@ in JSON response","user":{"login":"inanzzz","id":8837278,"avatar_url":"https://avatars.githubusercontent.com/u/8837278?v=3","gravatar_id":"","url":"https://api.github.com/users/inanzzz","html_url":"https://github.com/inanzzz","followers_url":"https://api.github.com/users/inanzzz/followers","following_url":"https://api.github.com/users/inanzzz/following{/other_user}","gists_url":"https://api.github.com/users/inanzzz/gists{/gist_id}","starred_url":"https://api.github.com/users/inanzzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inanzzz/subscriptions","organizations_url":"https://api.github.com/users/inanzzz/orgs","repos_url":"https://api.github.com/users/inanzzz/repos","events_url":"https://api.github.com/users/inanzzz/events{/privacy}","received_events_url":"https://api.github.com/users/inanzzz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-16T09:45:32Z","updated_at":"2015-01-26T21:39:00Z","closed_at":"2015-01-16T12:42:27Z","body":"Hi,\r\n\r\nSince `batch1064` always differs I would like to replace it with `@string@` but when I do that tests still fail.\r\n\r\nI'm using Symfony2 and have run `composer require --dev \"coduo/php-matcher\"` and all went fine. Apart from replacing `batch1064` with `@string@`, what else should I do? E.g. I'm seeing two lines below as standard but where do I put them? Somewhere in FeatureContext.php, maybe?\r\n\r\n`@Then /^(?:the )?response should contain json:$/` is a build-in method in [WebApiContext.php](https://github.com/Behat/CommonContexts/blob/master/Behat/CommonContexts/WebApiContext.php#L182) of Behat.\r\n\r\n```\r\n$factory = new SimpleFactory();\r\n$matcher = $factory->createMatcher();\r\n```\r\n\r\nMY EXAMPLE\r\n```\r\n  Scenario: Whatever whatever\r\n    When I send a GET request to \"/1/products?id=1\"\r\n    Then the response should contain json:\r\n    \"\"\"\r\n    {\r\n      \"products\": [\r\n        {\r\n          \"name\": \"Aaaa\",\r\n          \"images\": [\r\n            {\r\n              \"type\": \"url\",\r\n              \"value\": \"http:\\/\\/www.abc.com\\/imagegallery\\/batch1064\\/image.JPG\"\r\n            }\r\n          ]\r\n        }\r\n      ]\r\n    }\r\n    \"\"\"\r\n```"},"comment":{"url":"https://api.github.com/repos/coduo/php-matcher/issues/comments/71543708","html_url":"https://github.com/coduo/php-matcher/issues/47#issuecomment-71543708","issue_url":"https://api.github.com/repos/coduo/php-matcher/issues/47","id":71543708,"user":{"login":"norzechowicz","id":1921950,"avatar_url":"https://avatars.githubusercontent.com/u/1921950?v=3","gravatar_id":"","url":"https://api.github.com/users/norzechowicz","html_url":"https://github.com/norzechowicz","followers_url":"https://api.github.com/users/norzechowicz/followers","following_url":"https://api.github.com/users/norzechowicz/following{/other_user}","gists_url":"https://api.github.com/users/norzechowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/norzechowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norzechowicz/subscriptions","organizations_url":"https://api.github.com/users/norzechowicz/orgs","repos_url":"https://api.github.com/users/norzechowicz/repos","events_url":"https://api.github.com/users/norzechowicz/events{/privacy}","received_events_url":"https://api.github.com/users/norzechowicz/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T21:39:00Z","updated_at":"2015-01-26T21:39:00Z","body":"This is why I dont like behat extensions that adds \"universal\" steps.\r\nAnyway you can just simply create a step in your feature:\r\n```Then json response should match:```\r\n\r\nwhich should alllow you to generate following method in your Context class. \r\n\r\n```php\r\n    /**\r\n     * @Then json response should match:\r\n     */\r\n    public function jsonResponseShouldMatch(PyStringNode $jsonPattern)\r\n    {\r\n        $matcher = (new SimpleFactory())->createMatcher();\r\n\r\n        if (!$matcher->match($this->getSession()->getPage()->getContent(), (string) $jsonPattern)) {\r\n            throw new \\RuntimeException($matcher->getError());\r\n        }\r\n    }\r\n```\r\n\r\nP.S. sorry for my late response"}}