{"action":"created","issue":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/2570","labels_url":"https://api.github.com/repos/Codeception/Codeception/issues/2570/labels{/name}","comments_url":"https://api.github.com/repos/Codeception/Codeception/issues/2570/comments","events_url":"https://api.github.com/repos/Codeception/Codeception/issues/2570/events","html_url":"https://github.com/Codeception/Codeception/issues/2570","id":118335128,"number":2570,"title":"seeResponseIsJson is retrieving json decoding error #4","user":{"login":"katmel98","id":1301339,"avatar_url":"https://avatars.githubusercontent.com/u/1301339?v=3","gravatar_id":"","url":"https://api.github.com/users/katmel98","html_url":"https://github.com/katmel98","followers_url":"https://api.github.com/users/katmel98/followers","following_url":"https://api.github.com/users/katmel98/following{/other_user}","gists_url":"https://api.github.com/users/katmel98/gists{/gist_id}","starred_url":"https://api.github.com/users/katmel98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katmel98/subscriptions","organizations_url":"https://api.github.com/users/katmel98/orgs","repos_url":"https://api.github.com/users/katmel98/repos","events_url":"https://api.github.com/users/katmel98/events{/privacy}","received_events_url":"https://api.github.com/users/katmel98/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-23T08:04:20Z","updated_at":"2015-11-23T10:27:21Z","closed_at":null,"body":"Good morning, I'm using CodeCeption to test a REST API.\r\n\r\nNow I'm running this test:\r\n\r\n<?php \r\n$I = new ApiTester($scenario);\r\n$I->wantTo('Discard create an user via API because bad JSON format');\r\n$I->haveHTTPHeader('Content-Type', 'application/json');\r\n$I->sendPOST('patient/',badObject);\r\n$I->seeResponseCodeIs(400);\r\n$I->seeResponseIsJson();\r\n$I->seeResponseContains('\"app_error_code\":1001');\r\n\r\nThe test is working fine until \"$I->seeResponseIsJson();\" line. When the test gets into this line it outputs an error: \r\n\r\n>Step  I see response is json \r\n> Fail  json decoding error #4, see http://php.net/manual/en/function.json-last-error.php\r\n>Failed asserting that 4 matches expected 0.\r\n\r\nThe json returned by the REST API is:\r\n\r\n{\"app_error_code\":1001,\"app_error_messages\":[\"El objeto paciente enviado no es válido\"]}\r\n\r\nIt's a valid json so I don't understand why it's failing.\r\n\r\nCould you help me on this?\r\n\r\nThanks in advance.\r\n\r\np.d.: I've been investigating over here and it seems that this behavior have been reported before but it is still giving me this error."},"comment":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/comments/158898259","html_url":"https://github.com/Codeception/Codeception/issues/2570#issuecomment-158898259","issue_url":"https://api.github.com/repos/Codeception/Codeception/issues/2570","id":158898259,"user":{"login":"katmel98","id":1301339,"avatar_url":"https://avatars.githubusercontent.com/u/1301339?v=3","gravatar_id":"","url":"https://api.github.com/users/katmel98","html_url":"https://github.com/katmel98","followers_url":"https://api.github.com/users/katmel98/followers","following_url":"https://api.github.com/users/katmel98/following{/other_user}","gists_url":"https://api.github.com/users/katmel98/gists{/gist_id}","starred_url":"https://api.github.com/users/katmel98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katmel98/subscriptions","organizations_url":"https://api.github.com/users/katmel98/orgs","repos_url":"https://api.github.com/users/katmel98/repos","events_url":"https://api.github.com/users/katmel98/events{/privacy}","received_events_url":"https://api.github.com/users/katmel98/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T10:27:21Z","updated_at":"2015-11-23T10:27:21Z","body":"Sorry my mistake closing it :-("}}