{"action":"created","comment":{"url":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/comments/63577198","id":63577198,"diff_hunk":"@@ -0,0 +1,77 @@\n+<?php\n+\n+namespace SensioLabs\\AstRunner\\Tests\\Command;\n+\n+use Humbug\\SelfUpdate\\Updater;\n+use SensioLabs\\Deptrac\\Command\\SelfUpdateCommand;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+use Humbug\\SelfUpdate\\Exception\\HttpRequestException;\n+use Prophecy\\Argument;\n+\n+class SelfUpdateCommandTest extends \\PHPUnit_Framework_TestCase\n+{\n+    /**\n+     * @var \\Prophecy\\Prophecy\\ObjectProphecy\n+     */\n+    private $updater;\n+\n+    /**\n+     * @var \\Prophecy\\Prophecy\\ObjectProphecy\n+     */\n+    private $input;\n+\n+    /**\n+     * @var \\Prophecy\\Prophecy\\ObjectProphecy\n+     */\n+    private $output;\n+\n+    protected function setUp()\n+    {\n+        $this->updater = $this->prophesize(Updater::class);\n+        $this->input = $this->prophesize(InputInterface::class);\n+        $this->output = $this->prophesize(OutputInterface::class);\n+    }\n+\n+    /**\n+     * Tests the command status is 1 (fail) if the update fails\n+     */\n+    public function testUpdateFail()\n+    {\n+        $this->updater->update()->willThrow(HttpRequestException::class);\n+\n+        $command = new SelfUpdateCommand($this->updater->reveal());\n+        $result = $command->run($this->input->reveal(), $this->output->reveal());\n+\n+        $this->assertSame(1, $result);\n+    }\n+\n+    /**\n+     * Tests the command status is 0 (success) if the update success or is not necessary\n+     *\n+     * @param $isPharOutdated\n+     *\n+     * @dataProvider testUpdateSuccessProvider\n+     */\n+    public function testUpdateSuccess($isPharOutdated)\n+    {\n+        if ($isPharOutdated) {\n+            $this->updater->update()->willReturn(true);\n+        } else {\n+            $this->updater->update()->willReturn(false);\n+        }\n+\n+        $command = new SelfUpdateCommand($this->updater->reveal());\n+        $result = $command->run($this->input->reveal(), $this->output->reveal());\n+\n+        $this->assertSame(0, $result);\n+    }\n+\n+    public function testUpdateSuccessProvider()\n+    {\n+        yield [","path":"src/Tests/Command/SelfUpdateCommandTest.php","position":72,"original_position":72,"commit_id":"41e8a8a4284304fa3a71fc5024677e6543d11f33","original_commit_id":"41e8a8a4284304fa3a71fc5024677e6543d11f33","user":{"login":"slde-flash","id":7532909,"avatar_url":"https://avatars.githubusercontent.com/u/7532909?v=3","gravatar_id":"","url":"https://api.github.com/users/slde-flash","html_url":"https://github.com/slde-flash","followers_url":"https://api.github.com/users/slde-flash/followers","following_url":"https://api.github.com/users/slde-flash/following{/other_user}","gists_url":"https://api.github.com/users/slde-flash/gists{/gist_id}","starred_url":"https://api.github.com/users/slde-flash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slde-flash/subscriptions","organizations_url":"https://api.github.com/users/slde-flash/orgs","repos_url":"https://api.github.com/users/slde-flash/repos","events_url":"https://api.github.com/users/slde-flash/events{/privacy}","received_events_url":"https://api.github.com/users/slde-flash/received_events","type":"User","site_admin":false},"body":"this should be \r\n\r\n```\r\nyield [true],\r\nyield [false]\r\n```","created_at":"2016-05-17T18:25:50Z","updated_at":"2016-05-17T18:25:50Z","html_url":"https://github.com/sensiolabs-de/deptrac/pull/98#discussion_r63577198","pull_request_url":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/comments/63577198"},"html":{"href":"https://github.com/sensiolabs-de/deptrac/pull/98#discussion_r63577198"},"pull_request":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98","id":70388133,"html_url":"https://github.com/sensiolabs-de/deptrac/pull/98","diff_url":"https://github.com/sensiolabs-de/deptrac/pull/98.diff","patch_url":"https://github.com/sensiolabs-de/deptrac/pull/98.patch","issue_url":"https://api.github.com/repos/sensiolabs-de/deptrac/issues/98","number":98,"state":"open","locked":false,"title":"Add tests for self update command","user":{"login":"amansilla","id":1576983,"avatar_url":"https://avatars.githubusercontent.com/u/1576983?v=3","gravatar_id":"","url":"https://api.github.com/users/amansilla","html_url":"https://github.com/amansilla","followers_url":"https://api.github.com/users/amansilla/followers","following_url":"https://api.github.com/users/amansilla/following{/other_user}","gists_url":"https://api.github.com/users/amansilla/gists{/gist_id}","starred_url":"https://api.github.com/users/amansilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amansilla/subscriptions","organizations_url":"https://api.github.com/users/amansilla/orgs","repos_url":"https://api.github.com/users/amansilla/repos","events_url":"https://api.github.com/users/amansilla/events{/privacy}","received_events_url":"https://api.github.com/users/amansilla/received_events","type":"User","site_admin":false},"body":"This pull requests add some tests for the self-update command. \r\n\r\nThe command itself was added as well in order to allow testing but there is a dedicated pull request for that, see #84.","created_at":"2016-05-17T16:27:38Z","updated_at":"2016-05-17T18:25:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"accd6522280116cff0274519bb60053b6c61aa7c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98/commits","review_comments_url":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98/comments","review_comment_url":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sensiolabs-de/deptrac/issues/98/comments","statuses_url":"https://api.github.com/repos/sensiolabs-de/deptrac/statuses/41e8a8a4284304fa3a71fc5024677e6543d11f33","head":{"label":"amansilla:self-update-command-tests","ref":"self-update-command-tests","sha":"41e8a8a4284304fa3a71fc5024677e6543d11f33","user":{"login":"amansilla","id":1576983,"avatar_url":"https://avatars.githubusercontent.com/u/1576983?v=3","gravatar_id":"","url":"https://api.github.com/users/amansilla","html_url":"https://github.com/amansilla","followers_url":"https://api.github.com/users/amansilla/followers","following_url":"https://api.github.com/users/amansilla/following{/other_user}","gists_url":"https://api.github.com/users/amansilla/gists{/gist_id}","starred_url":"https://api.github.com/users/amansilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amansilla/subscriptions","organizations_url":"https://api.github.com/users/amansilla/orgs","repos_url":"https://api.github.com/users/amansilla/repos","events_url":"https://api.github.com/users/amansilla/events{/privacy}","received_events_url":"https://api.github.com/users/amansilla/received_events","type":"User","site_admin":false},"repo":{"id":57434050,"name":"deptrac","full_name":"amansilla/deptrac","owner":{"login":"amansilla","id":1576983,"avatar_url":"https://avatars.githubusercontent.com/u/1576983?v=3","gravatar_id":"","url":"https://api.github.com/users/amansilla","html_url":"https://github.com/amansilla","followers_url":"https://api.github.com/users/amansilla/followers","following_url":"https://api.github.com/users/amansilla/following{/other_user}","gists_url":"https://api.github.com/users/amansilla/gists{/gist_id}","starred_url":"https://api.github.com/users/amansilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amansilla/subscriptions","organizations_url":"https://api.github.com/users/amansilla/orgs","repos_url":"https://api.github.com/users/amansilla/repos","events_url":"https://api.github.com/users/amansilla/events{/privacy}","received_events_url":"https://api.github.com/users/amansilla/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amansilla/deptrac","description":"Keeps your architecture clean.","fork":true,"url":"https://api.github.com/repos/amansilla/deptrac","forks_url":"https://api.github.com/repos/amansilla/deptrac/forks","keys_url":"https://api.github.com/repos/amansilla/deptrac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amansilla/deptrac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amansilla/deptrac/teams","hooks_url":"https://api.github.com/repos/amansilla/deptrac/hooks","issue_events_url":"https://api.github.com/repos/amansilla/deptrac/issues/events{/number}","events_url":"https://api.github.com/repos/amansilla/deptrac/events","assignees_url":"https://api.github.com/repos/amansilla/deptrac/assignees{/user}","branches_url":"https://api.github.com/repos/amansilla/deptrac/branches{/branch}","tags_url":"https://api.github.com/repos/amansilla/deptrac/tags","blobs_url":"https://api.github.com/repos/amansilla/deptrac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amansilla/deptrac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amansilla/deptrac/git/refs{/sha}","trees_url":"https://api.github.com/repos/amansilla/deptrac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amansilla/deptrac/statuses/{sha}","languages_url":"https://api.github.com/repos/amansilla/deptrac/languages","stargazers_url":"https://api.github.com/repos/amansilla/deptrac/stargazers","contributors_url":"https://api.github.com/repos/amansilla/deptrac/contributors","subscribers_url":"https://api.github.com/repos/amansilla/deptrac/subscribers","subscription_url":"https://api.github.com/repos/amansilla/deptrac/subscription","commits_url":"https://api.github.com/repos/amansilla/deptrac/commits{/sha}","git_commits_url":"https://api.github.com/repos/amansilla/deptrac/git/commits{/sha}","comments_url":"https://api.github.com/repos/amansilla/deptrac/comments{/number}","issue_comment_url":"https://api.github.com/repos/amansilla/deptrac/issues/comments{/number}","contents_url":"https://api.github.com/repos/amansilla/deptrac/contents/{+path}","compare_url":"https://api.github.com/repos/amansilla/deptrac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amansilla/deptrac/merges","archive_url":"https://api.github.com/repos/amansilla/deptrac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amansilla/deptrac/downloads","issues_url":"https://api.github.com/repos/amansilla/deptrac/issues{/number}","pulls_url":"https://api.github.com/repos/amansilla/deptrac/pulls{/number}","milestones_url":"https://api.github.com/repos/amansilla/deptrac/milestones{/number}","notifications_url":"https://api.github.com/repos/amansilla/deptrac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amansilla/deptrac/labels{/name}","releases_url":"https://api.github.com/repos/amansilla/deptrac/releases{/id}","deployments_url":"https://api.github.com/repos/amansilla/deptrac/deployments","created_at":"2016-04-30T08:42:17Z","updated_at":"2016-04-30T08:42:19Z","pushed_at":"2016-05-17T16:30:44Z","git_url":"git://github.com/amansilla/deptrac.git","ssh_url":"git@github.com:amansilla/deptrac.git","clone_url":"https://github.com/amansilla/deptrac.git","svn_url":"https://github.com/amansilla/deptrac","homepage":"","size":482,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sensiolabs-de:master","ref":"master","sha":"fc54fa154d2d1a726ffcf7a000273df917654f24","user":{"login":"sensiolabs-de","id":1536835,"avatar_url":"https://avatars.githubusercontent.com/u/1536835?v=3","gravatar_id":"","url":"https://api.github.com/users/sensiolabs-de","html_url":"https://github.com/sensiolabs-de","followers_url":"https://api.github.com/users/sensiolabs-de/followers","following_url":"https://api.github.com/users/sensiolabs-de/following{/other_user}","gists_url":"https://api.github.com/users/sensiolabs-de/gists{/gist_id}","starred_url":"https://api.github.com/users/sensiolabs-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensiolabs-de/subscriptions","organizations_url":"https://api.github.com/users/sensiolabs-de/orgs","repos_url":"https://api.github.com/users/sensiolabs-de/repos","events_url":"https://api.github.com/users/sensiolabs-de/events{/privacy}","received_events_url":"https://api.github.com/users/sensiolabs-de/received_events","type":"Organization","site_admin":false},"repo":{"id":45259338,"name":"deptrac","full_name":"sensiolabs-de/deptrac","owner":{"login":"sensiolabs-de","id":1536835,"avatar_url":"https://avatars.githubusercontent.com/u/1536835?v=3","gravatar_id":"","url":"https://api.github.com/users/sensiolabs-de","html_url":"https://github.com/sensiolabs-de","followers_url":"https://api.github.com/users/sensiolabs-de/followers","following_url":"https://api.github.com/users/sensiolabs-de/following{/other_user}","gists_url":"https://api.github.com/users/sensiolabs-de/gists{/gist_id}","starred_url":"https://api.github.com/users/sensiolabs-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensiolabs-de/subscriptions","organizations_url":"https://api.github.com/users/sensiolabs-de/orgs","repos_url":"https://api.github.com/users/sensiolabs-de/repos","events_url":"https://api.github.com/users/sensiolabs-de/events{/privacy}","received_events_url":"https://api.github.com/users/sensiolabs-de/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sensiolabs-de/deptrac","description":"Keep your architecture clean.","fork":false,"url":"https://api.github.com/repos/sensiolabs-de/deptrac","forks_url":"https://api.github.com/repos/sensiolabs-de/deptrac/forks","keys_url":"https://api.github.com/repos/sensiolabs-de/deptrac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sensiolabs-de/deptrac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sensiolabs-de/deptrac/teams","hooks_url":"https://api.github.com/repos/sensiolabs-de/deptrac/hooks","issue_events_url":"https://api.github.com/repos/sensiolabs-de/deptrac/issues/events{/number}","events_url":"https://api.github.com/repos/sensiolabs-de/deptrac/events","assignees_url":"https://api.github.com/repos/sensiolabs-de/deptrac/assignees{/user}","branches_url":"https://api.github.com/repos/sensiolabs-de/deptrac/branches{/branch}","tags_url":"https://api.github.com/repos/sensiolabs-de/deptrac/tags","blobs_url":"https://api.github.com/repos/sensiolabs-de/deptrac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sensiolabs-de/deptrac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sensiolabs-de/deptrac/git/refs{/sha}","trees_url":"https://api.github.com/repos/sensiolabs-de/deptrac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sensiolabs-de/deptrac/statuses/{sha}","languages_url":"https://api.github.com/repos/sensiolabs-de/deptrac/languages","stargazers_url":"https://api.github.com/repos/sensiolabs-de/deptrac/stargazers","contributors_url":"https://api.github.com/repos/sensiolabs-de/deptrac/contributors","subscribers_url":"https://api.github.com/repos/sensiolabs-de/deptrac/subscribers","subscription_url":"https://api.github.com/repos/sensiolabs-de/deptrac/subscription","commits_url":"https://api.github.com/repos/sensiolabs-de/deptrac/commits{/sha}","git_commits_url":"https://api.github.com/repos/sensiolabs-de/deptrac/git/commits{/sha}","comments_url":"https://api.github.com/repos/sensiolabs-de/deptrac/comments{/number}","issue_comment_url":"https://api.github.com/repos/sensiolabs-de/deptrac/issues/comments{/number}","contents_url":"https://api.github.com/repos/sensiolabs-de/deptrac/contents/{+path}","compare_url":"https://api.github.com/repos/sensiolabs-de/deptrac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sensiolabs-de/deptrac/merges","archive_url":"https://api.github.com/repos/sensiolabs-de/deptrac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sensiolabs-de/deptrac/downloads","issues_url":"https://api.github.com/repos/sensiolabs-de/deptrac/issues{/number}","pulls_url":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls{/number}","milestones_url":"https://api.github.com/repos/sensiolabs-de/deptrac/milestones{/number}","notifications_url":"https://api.github.com/repos/sensiolabs-de/deptrac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sensiolabs-de/deptrac/labels{/name}","releases_url":"https://api.github.com/repos/sensiolabs-de/deptrac/releases{/id}","deployments_url":"https://api.github.com/repos/sensiolabs-de/deptrac/deployments","created_at":"2015-10-30T15:28:28Z","updated_at":"2016-05-17T13:46:34Z","pushed_at":"2016-05-17T18:09:19Z","git_url":"git://github.com/sensiolabs-de/deptrac.git","ssh_url":"git@github.com:sensiolabs-de/deptrac.git","clone_url":"https://github.com/sensiolabs-de/deptrac.git","svn_url":"https://github.com/sensiolabs-de/deptrac","homepage":"","size":534,"stargazers_count":310,"watchers_count":310,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":16,"forks":20,"open_issues":16,"watchers":310,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98"},"html":{"href":"https://github.com/sensiolabs-de/deptrac/pull/98"},"issue":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/issues/98"},"comments":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/sensiolabs-de/deptrac/statuses/41e8a8a4284304fa3a71fc5024677e6543d11f33"}}}}