{"action":"opened","number":148,"pull_request":{"url":"https://api.github.com/repos/laravel/lumen-framework/pulls/148","id":37863828,"html_url":"https://github.com/laravel/lumen-framework/pull/148","diff_url":"https://github.com/laravel/lumen-framework/pull/148.diff","patch_url":"https://github.com/laravel/lumen-framework/pull/148.patch","issue_url":"https://api.github.com/repos/laravel/lumen-framework/issues/148","number":148,"state":"open","locked":false,"title":"Assert response is JSON even when data is passed","user":{"login":"gerrywastaken","id":71481,"avatar_url":"https://avatars.githubusercontent.com/u/71481?v=3","gravatar_id":"","url":"https://api.github.com/users/gerrywastaken","html_url":"https://github.com/gerrywastaken","followers_url":"https://api.github.com/users/gerrywastaken/followers","following_url":"https://api.github.com/users/gerrywastaken/following{/other_user}","gists_url":"https://api.github.com/users/gerrywastaken/gists{/gist_id}","starred_url":"https://api.github.com/users/gerrywastaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerrywastaken/subscriptions","organizations_url":"https://api.github.com/users/gerrywastaken/orgs","repos_url":"https://api.github.com/users/gerrywastaken/repos","events_url":"https://api.github.com/users/gerrywastaken/events{/privacy}","received_events_url":"https://api.github.com/users/gerrywastaken/received_events","type":"User","site_admin":false},"body":"Not testing the response when we have data, means that an invalid JSON response results a confusing error:\r\n\r\n1) AccountTest::testBasicCreate\r\nErrorException: Invalid argument supplied for foreach()\r\n\r\n<project-dir>/vendor/illuminate/support/helpers.php:534\r\n<project-dir>/vendor/laravel/lumen-framework/src/Testing/CrawlerTrait.php:311\r\n<project-dir>/vendor/laravel/lumen-framework/src/Testing/CrawlerTrait.php:298\r\n<project-dir>/xero_api/tests/endpoints/AccountTest.php:66\r\n<project-dir>/xero_api/tests/endpoints/AccountTest.php:16\r\n<project-dir>/phpunit/phpunit/src/TextUI/Command.php:151\r\n<project-dir>/phpunit/phpunit/src/TextUI/Command.php:103\r\n\r\nAfter this fix an invalid JSON response results in:\r\n\r\nFailed asserting that JSON returned [http://localhost/account/1].\r\nFailed asserting that '<!DOCTYPE html>\\n<html>\\n    <h.../html>' is valid JSON (Syntax error, malformed JSON).","created_at":"2015-06-17T03:58:48Z","updated_at":"2015-06-17T03:58:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laravel/lumen-framework/pulls/148/commits","review_comments_url":"https://api.github.com/repos/laravel/lumen-framework/pulls/148/comments","review_comment_url":"https://api.github.com/repos/laravel/lumen-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laravel/lumen-framework/issues/148/comments","statuses_url":"https://api.github.com/repos/laravel/lumen-framework/statuses/b9d7474d9458413c1a98a87a098162d892cad7ae","head":{"label":"gerrywastaken:gerrywastaken-fix-see-json-on-non-json-response","ref":"gerrywastaken-fix-see-json-on-non-json-response","sha":"b9d7474d9458413c1a98a87a098162d892cad7ae","user":{"login":"gerrywastaken","id":71481,"avatar_url":"https://avatars.githubusercontent.com/u/71481?v=3","gravatar_id":"","url":"https://api.github.com/users/gerrywastaken","html_url":"https://github.com/gerrywastaken","followers_url":"https://api.github.com/users/gerrywastaken/followers","following_url":"https://api.github.com/users/gerrywastaken/following{/other_user}","gists_url":"https://api.github.com/users/gerrywastaken/gists{/gist_id}","starred_url":"https://api.github.com/users/gerrywastaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerrywastaken/subscriptions","organizations_url":"https://api.github.com/users/gerrywastaken/orgs","repos_url":"https://api.github.com/users/gerrywastaken/repos","events_url":"https://api.github.com/users/gerrywastaken/events{/privacy}","received_events_url":"https://api.github.com/users/gerrywastaken/received_events","type":"User","site_admin":false},"repo":{"id":37570427,"name":"lumen-framework","full_name":"gerrywastaken/lumen-framework","owner":{"login":"gerrywastaken","id":71481,"avatar_url":"https://avatars.githubusercontent.com/u/71481?v=3","gravatar_id":"","url":"https://api.github.com/users/gerrywastaken","html_url":"https://github.com/gerrywastaken","followers_url":"https://api.github.com/users/gerrywastaken/followers","following_url":"https://api.github.com/users/gerrywastaken/following{/other_user}","gists_url":"https://api.github.com/users/gerrywastaken/gists{/gist_id}","starred_url":"https://api.github.com/users/gerrywastaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerrywastaken/subscriptions","organizations_url":"https://api.github.com/users/gerrywastaken/orgs","repos_url":"https://api.github.com/users/gerrywastaken/repos","events_url":"https://api.github.com/users/gerrywastaken/events{/privacy}","received_events_url":"https://api.github.com/users/gerrywastaken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gerrywastaken/lumen-framework","description":"","fork":true,"url":"https://api.github.com/repos/gerrywastaken/lumen-framework","forks_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/forks","keys_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/teams","hooks_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/hooks","issue_events_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/issues/events{/number}","events_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/events","assignees_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/assignees{/user}","branches_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/branches{/branch}","tags_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/tags","blobs_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/languages","stargazers_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/stargazers","contributors_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/contributors","subscribers_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/subscribers","subscription_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/subscription","commits_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/contents/{+path}","compare_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/merges","archive_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/downloads","issues_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/issues{/number}","pulls_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/labels{/name}","releases_url":"https://api.github.com/repos/gerrywastaken/lumen-framework/releases{/id}","created_at":"2015-06-17T03:30:37Z","updated_at":"2015-06-17T03:30:37Z","pushed_at":"2015-06-17T03:57:31Z","git_url":"git://github.com/gerrywastaken/lumen-framework.git","ssh_url":"git@github.com:gerrywastaken/lumen-framework.git","clone_url":"https://github.com/gerrywastaken/lumen-framework.git","svn_url":"https://github.com/gerrywastaken/lumen-framework","homepage":null,"size":831,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"5.1"}},"base":{"label":"laravel:5.1","ref":"5.1","sha":"d91cd653624f473ec308e8ff863620a3b19fefd8","user":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"repo":{"id":33903775,"name":"lumen-framework","full_name":"laravel/lumen-framework","owner":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/laravel/lumen-framework","description":"","fork":false,"url":"https://api.github.com/repos/laravel/lumen-framework","forks_url":"https://api.github.com/repos/laravel/lumen-framework/forks","keys_url":"https://api.github.com/repos/laravel/lumen-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laravel/lumen-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laravel/lumen-framework/teams","hooks_url":"https://api.github.com/repos/laravel/lumen-framework/hooks","issue_events_url":"https://api.github.com/repos/laravel/lumen-framework/issues/events{/number}","events_url":"https://api.github.com/repos/laravel/lumen-framework/events","assignees_url":"https://api.github.com/repos/laravel/lumen-framework/assignees{/user}","branches_url":"https://api.github.com/repos/laravel/lumen-framework/branches{/branch}","tags_url":"https://api.github.com/repos/laravel/lumen-framework/tags","blobs_url":"https://api.github.com/repos/laravel/lumen-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laravel/lumen-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laravel/lumen-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/laravel/lumen-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laravel/lumen-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/laravel/lumen-framework/languages","stargazers_url":"https://api.github.com/repos/laravel/lumen-framework/stargazers","contributors_url":"https://api.github.com/repos/laravel/lumen-framework/contributors","subscribers_url":"https://api.github.com/repos/laravel/lumen-framework/subscribers","subscription_url":"https://api.github.com/repos/laravel/lumen-framework/subscription","commits_url":"https://api.github.com/repos/laravel/lumen-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/laravel/lumen-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/laravel/lumen-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/laravel/lumen-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/laravel/lumen-framework/contents/{+path}","compare_url":"https://api.github.com/repos/laravel/lumen-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laravel/lumen-framework/merges","archive_url":"https://api.github.com/repos/laravel/lumen-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laravel/lumen-framework/downloads","issues_url":"https://api.github.com/repos/laravel/lumen-framework/issues{/number}","pulls_url":"https://api.github.com/repos/laravel/lumen-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/laravel/lumen-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/laravel/lumen-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laravel/lumen-framework/labels{/name}","releases_url":"https://api.github.com/repos/laravel/lumen-framework/releases{/id}","created_at":"2015-04-14T01:30:27Z","updated_at":"2015-06-17T03:51:46Z","pushed_at":"2015-06-17T03:58:48Z","git_url":"git://github.com/laravel/lumen-framework.git","ssh_url":"git@github.com:laravel/lumen-framework.git","clone_url":"https://github.com/laravel/lumen-framework.git","svn_url":"https://github.com/laravel/lumen-framework","homepage":null,"size":831,"stargazers_count":282,"watchers_count":282,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":78,"mirror_url":null,"open_issues_count":14,"forks":78,"open_issues":14,"watchers":282,"default_branch":"5.1"}},"_links":{"self":{"href":"https://api.github.com/repos/laravel/lumen-framework/pulls/148"},"html":{"href":"https://github.com/laravel/lumen-framework/pull/148"},"issue":{"href":"https://api.github.com/repos/laravel/lumen-framework/issues/148"},"comments":{"href":"https://api.github.com/repos/laravel/lumen-framework/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/laravel/lumen-framework/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/laravel/lumen-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laravel/lumen-framework/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/laravel/lumen-framework/statuses/b9d7474d9458413c1a98a87a098162d892cad7ae"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":4,"deletions":8,"changed_files":1}}