{"action":"created","comment":{"url":"https://api.github.com/repos/equip/auth/pulls/comments/52483493","id":52483493,"diff_hunk":"@@ -53,30 +53,16 @@ protected function setUp()\n \n     public function testParseTokenWithExpiredToken()\n     {\n-        $parser = new FirebaseParser($this->config);\n+        $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ1cmkiLCJpYXQiOiIxNDQzNzE5MjM2IiwiZXhwIjoxNDQzNzIyODM2LCJzdWIiOiJ1c2VyLTEifQ.YquvWRtH72muTv1hCCKH4HBkBhhCm1wTG0MpnyC-pvQ';\n \n-        try {\n-            $parser->parseToken(\n-                'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ1cmkiLCJpYXQiOiIxNDQzNzE5MjM2IiwiZXhwIjoxNDQzNzIyODM2LCJzdWIiOiJ1c2VyLTEifQ.YquvWRtH72muTv1hCCKH4HBkBhhCm1wTG0MpnyC-pvQ'\n-            );\n-            $this->fail('Expected exception was not thrown');\n-        } catch (InvalidException $e) {\n-            $this->assertSame(InvalidException::CODE_TOKEN_EXPIRED, $e->getCode());\n-        }\n-    }\n+        $this->setExpectedException(\n+            InvalidException::class,\n+            sprintf('Provided auth token `%s` is expired', $token),","path":"tests/Jwt/FirebaseParserTest.php","position":null,"original_position":36,"commit_id":"7a7bcc2133277ad202a7992d10e5ede078b3e240","original_commit_id":"f4e3f903e24c2b1810eff4d3eb681ffbffd6567b","user":{"login":"elazar","id":15487,"avatar_url":"https://avatars.githubusercontent.com/u/15487?v=3","gravatar_id":"","url":"https://api.github.com/users/elazar","html_url":"https://github.com/elazar","followers_url":"https://api.github.com/users/elazar/followers","following_url":"https://api.github.com/users/elazar/following{/other_user}","gists_url":"https://api.github.com/users/elazar/gists{/gist_id}","starred_url":"https://api.github.com/users/elazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elazar/subscriptions","organizations_url":"https://api.github.com/users/elazar/orgs","repos_url":"https://api.github.com/users/elazar/repos","events_url":"https://api.github.com/users/elazar/events{/privacy}","received_events_url":"https://api.github.com/users/elazar/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2016-02-10T16:33:31Z","updated_at":"2016-02-10T16:33:31Z","html_url":"https://github.com/equip/auth/pull/4#discussion_r52483493","pull_request_url":"https://api.github.com/repos/equip/auth/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/equip/auth/pulls/comments/52483493"},"html":{"href":"https://github.com/equip/auth/pull/4#discussion_r52483493"},"pull_request":{"href":"https://api.github.com/repos/equip/auth/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/equip/auth/pulls/4","id":58655976,"html_url":"https://github.com/equip/auth/pull/4","diff_url":"https://github.com/equip/auth/pull/4.diff","patch_url":"https://github.com/equip/auth/pull/4.patch","issue_url":"https://api.github.com/repos/equip/auth/issues/4","number":4,"state":"open","locked":false,"title":"Modify exceptions to return HTTP status codes","user":{"login":"elazar","id":15487,"avatar_url":"https://avatars.githubusercontent.com/u/15487?v=3","gravatar_id":"","url":"https://api.github.com/users/elazar","html_url":"https://github.com/elazar","followers_url":"https://api.github.com/users/elazar/followers","following_url":"https://api.github.com/users/elazar/following{/other_user}","gists_url":"https://api.github.com/users/elazar/gists{/gist_id}","starred_url":"https://api.github.com/users/elazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elazar/subscriptions","organizations_url":"https://api.github.com/users/elazar/orgs","repos_url":"https://api.github.com/users/elazar/repos","events_url":"https://api.github.com/users/elazar/events{/privacy}","received_events_url":"https://api.github.com/users/elazar/received_events","type":"User","site_admin":false},"body":"This addresses an interoperability issue between equip/framework and equip/auth. The latter has `getStatusCode()` methods in its exception classes ([example](https://github.com/equip/auth/blob/8e3fe70d4c44a362746ac6964f83a8c4e380107d/src/Exception/UnauthorizedException.php)). It doesn't appear that we specify a code value in equip/auth when throwing an exception ([example](https://github.com/equip/auth/blob/8e3fe70d4c44a362746ac6964f83a8c4e380107d/src/AuthHandler.php#L71)). However, `ExceptionHandler` in equip/framework doesn't check for `getStatusCode()` methods, so it ends up [always returning a 500](https://github.com/equip/framework/blob/118e9ae58eb9f60d2ab2d43fa18c521f18745ff2/src/Handler/ExceptionHandler.php#L73-L78).\r\n\r\nThis PR attempts to address this in the easiest way possible: having equip/auth depend on equip/framework is to modify the exception classes in equip/auth to use HTTP status codes as exception codes, so that `ExceptionHandler` will use them.","created_at":"2016-02-08T19:35:05Z","updated_at":"2016-02-10T16:33:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e6d9005afc915400ea0e77d1fd061a42544f25d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/equip/auth/pulls/4/commits","review_comments_url":"https://api.github.com/repos/equip/auth/pulls/4/comments","review_comment_url":"https://api.github.com/repos/equip/auth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/equip/auth/issues/4/comments","statuses_url":"https://api.github.com/repos/equip/auth/statuses/7a7bcc2133277ad202a7992d10e5ede078b3e240","head":{"label":"equip:hotfix/exceptions","ref":"hotfix/exceptions","sha":"7a7bcc2133277ad202a7992d10e5ede078b3e240","user":{"login":"equip","id":16503086,"avatar_url":"https://avatars.githubusercontent.com/u/16503086?v=3","gravatar_id":"","url":"https://api.github.com/users/equip","html_url":"https://github.com/equip","followers_url":"https://api.github.com/users/equip/followers","following_url":"https://api.github.com/users/equip/following{/other_user}","gists_url":"https://api.github.com/users/equip/gists{/gist_id}","starred_url":"https://api.github.com/users/equip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equip/subscriptions","organizations_url":"https://api.github.com/users/equip/orgs","repos_url":"https://api.github.com/users/equip/repos","events_url":"https://api.github.com/users/equip/events{/privacy}","received_events_url":"https://api.github.com/users/equip/received_events","type":"Organization","site_admin":false},"repo":{"id":49070478,"name":"auth","full_name":"equip/auth","owner":{"login":"equip","id":16503086,"avatar_url":"https://avatars.githubusercontent.com/u/16503086?v=3","gravatar_id":"","url":"https://api.github.com/users/equip","html_url":"https://github.com/equip","followers_url":"https://api.github.com/users/equip/followers","following_url":"https://api.github.com/users/equip/following{/other_user}","gists_url":"https://api.github.com/users/equip/gists{/gist_id}","starred_url":"https://api.github.com/users/equip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equip/subscriptions","organizations_url":"https://api.github.com/users/equip/orgs","repos_url":"https://api.github.com/users/equip/repos","events_url":"https://api.github.com/users/equip/events{/privacy}","received_events_url":"https://api.github.com/users/equip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/equip/auth","description":"Simple middleware for custom authentication.","fork":false,"url":"https://api.github.com/repos/equip/auth","forks_url":"https://api.github.com/repos/equip/auth/forks","keys_url":"https://api.github.com/repos/equip/auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/equip/auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/equip/auth/teams","hooks_url":"https://api.github.com/repos/equip/auth/hooks","issue_events_url":"https://api.github.com/repos/equip/auth/issues/events{/number}","events_url":"https://api.github.com/repos/equip/auth/events","assignees_url":"https://api.github.com/repos/equip/auth/assignees{/user}","branches_url":"https://api.github.com/repos/equip/auth/branches{/branch}","tags_url":"https://api.github.com/repos/equip/auth/tags","blobs_url":"https://api.github.com/repos/equip/auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/equip/auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/equip/auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/equip/auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/equip/auth/statuses/{sha}","languages_url":"https://api.github.com/repos/equip/auth/languages","stargazers_url":"https://api.github.com/repos/equip/auth/stargazers","contributors_url":"https://api.github.com/repos/equip/auth/contributors","subscribers_url":"https://api.github.com/repos/equip/auth/subscribers","subscription_url":"https://api.github.com/repos/equip/auth/subscription","commits_url":"https://api.github.com/repos/equip/auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/equip/auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/equip/auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/equip/auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/equip/auth/contents/{+path}","compare_url":"https://api.github.com/repos/equip/auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/equip/auth/merges","archive_url":"https://api.github.com/repos/equip/auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/equip/auth/downloads","issues_url":"https://api.github.com/repos/equip/auth/issues{/number}","pulls_url":"https://api.github.com/repos/equip/auth/pulls{/number}","milestones_url":"https://api.github.com/repos/equip/auth/milestones{/number}","notifications_url":"https://api.github.com/repos/equip/auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/equip/auth/labels{/name}","releases_url":"https://api.github.com/repos/equip/auth/releases{/id}","deployments_url":"https://api.github.com/repos/equip/auth/deployments","created_at":"2016-01-05T14:21:04Z","updated_at":"2016-02-03T15:03:54Z","pushed_at":"2016-02-10T16:33:21Z","git_url":"git://github.com/equip/auth.git","ssh_url":"git@github.com:equip/auth.git","clone_url":"https://github.com/equip/auth.git","svn_url":"https://github.com/equip/auth","homepage":null,"size":75,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"equip:master","ref":"master","sha":"8e3fe70d4c44a362746ac6964f83a8c4e380107d","user":{"login":"equip","id":16503086,"avatar_url":"https://avatars.githubusercontent.com/u/16503086?v=3","gravatar_id":"","url":"https://api.github.com/users/equip","html_url":"https://github.com/equip","followers_url":"https://api.github.com/users/equip/followers","following_url":"https://api.github.com/users/equip/following{/other_user}","gists_url":"https://api.github.com/users/equip/gists{/gist_id}","starred_url":"https://api.github.com/users/equip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equip/subscriptions","organizations_url":"https://api.github.com/users/equip/orgs","repos_url":"https://api.github.com/users/equip/repos","events_url":"https://api.github.com/users/equip/events{/privacy}","received_events_url":"https://api.github.com/users/equip/received_events","type":"Organization","site_admin":false},"repo":{"id":49070478,"name":"auth","full_name":"equip/auth","owner":{"login":"equip","id":16503086,"avatar_url":"https://avatars.githubusercontent.com/u/16503086?v=3","gravatar_id":"","url":"https://api.github.com/users/equip","html_url":"https://github.com/equip","followers_url":"https://api.github.com/users/equip/followers","following_url":"https://api.github.com/users/equip/following{/other_user}","gists_url":"https://api.github.com/users/equip/gists{/gist_id}","starred_url":"https://api.github.com/users/equip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equip/subscriptions","organizations_url":"https://api.github.com/users/equip/orgs","repos_url":"https://api.github.com/users/equip/repos","events_url":"https://api.github.com/users/equip/events{/privacy}","received_events_url":"https://api.github.com/users/equip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/equip/auth","description":"Simple middleware for custom authentication.","fork":false,"url":"https://api.github.com/repos/equip/auth","forks_url":"https://api.github.com/repos/equip/auth/forks","keys_url":"https://api.github.com/repos/equip/auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/equip/auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/equip/auth/teams","hooks_url":"https://api.github.com/repos/equip/auth/hooks","issue_events_url":"https://api.github.com/repos/equip/auth/issues/events{/number}","events_url":"https://api.github.com/repos/equip/auth/events","assignees_url":"https://api.github.com/repos/equip/auth/assignees{/user}","branches_url":"https://api.github.com/repos/equip/auth/branches{/branch}","tags_url":"https://api.github.com/repos/equip/auth/tags","blobs_url":"https://api.github.com/repos/equip/auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/equip/auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/equip/auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/equip/auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/equip/auth/statuses/{sha}","languages_url":"https://api.github.com/repos/equip/auth/languages","stargazers_url":"https://api.github.com/repos/equip/auth/stargazers","contributors_url":"https://api.github.com/repos/equip/auth/contributors","subscribers_url":"https://api.github.com/repos/equip/auth/subscribers","subscription_url":"https://api.github.com/repos/equip/auth/subscription","commits_url":"https://api.github.com/repos/equip/auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/equip/auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/equip/auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/equip/auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/equip/auth/contents/{+path}","compare_url":"https://api.github.com/repos/equip/auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/equip/auth/merges","archive_url":"https://api.github.com/repos/equip/auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/equip/auth/downloads","issues_url":"https://api.github.com/repos/equip/auth/issues{/number}","pulls_url":"https://api.github.com/repos/equip/auth/pulls{/number}","milestones_url":"https://api.github.com/repos/equip/auth/milestones{/number}","notifications_url":"https://api.github.com/repos/equip/auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/equip/auth/labels{/name}","releases_url":"https://api.github.com/repos/equip/auth/releases{/id}","deployments_url":"https://api.github.com/repos/equip/auth/deployments","created_at":"2016-01-05T14:21:04Z","updated_at":"2016-02-03T15:03:54Z","pushed_at":"2016-02-10T16:33:21Z","git_url":"git://github.com/equip/auth.git","ssh_url":"git@github.com:equip/auth.git","clone_url":"https://github.com/equip/auth.git","svn_url":"https://github.com/equip/auth","homepage":null,"size":75,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/equip/auth/pulls/4"},"html":{"href":"https://github.com/equip/auth/pull/4"},"issue":{"href":"https://api.github.com/repos/equip/auth/issues/4"},"comments":{"href":"https://api.github.com/repos/equip/auth/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/equip/auth/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/equip/auth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/equip/auth/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/equip/auth/statuses/7a7bcc2133277ad202a7992d10e5ede078b3e240"}}}}