{"action":"created","comment":{"url":"https://api.github.com/repos/phphants/phph-site/pulls/comments/83936320","pull_request_review_id":4746924,"id":83936320,"diff_hunk":"@@ -0,0 +1,173 @@\n+<?php\n+declare(strict_types = 1);\n+\n+namespace AppTest\\Action\\Account\\Speaker;\n+\n+use App\\Action\\Account\\Speaker\\EditSpeakerAction;\n+use App\\Entity\\Speaker;\n+use App\\Service\\Speaker\\FindSpeakerByUuidInterface;\n+use Doctrine\\ORM\\EntityManagerInterface;\n+use Zend\\Diactoros\\Response;\n+use Zend\\Diactoros\\ServerRequest;\n+use Zend\\Expressive\\Helper\\UrlHelper;\n+use Zend\\Expressive\\Template\\TemplateRendererInterface;\n+use Zend\\Form\\FormInterface;\n+\n+/**\n+ * @covers \\App\\Action\\Account\\Speaker\\EditSpeakerAction\n+ */\n+final class EditSpeakerActionTest extends \\PHPUnit_Framework_TestCase\n+{\n+    /**\n+     * @var FormInterface|\\PHPUnit_Framework_MockObject_MockObject\n+     */\n+    private $form;\n+\n+    /**\n+     * @var Speaker\n+     */\n+    private $speaker;\n+\n+    /**\n+     * @var TemplateRendererInterface|\\PHPUnit_Framework_MockObject_MockObject\n+     */\n+    private $renderer;\n+\n+    /**\n+     * @var UrlHelper|\\PHPUnit_Framework_MockObject_MockObject\n+     */\n+    private $urlHelper;\n+\n+    /**\n+     * @var EntityManagerInterface|\\PHPUnit_Framework_MockObject_MockObject\n+     */\n+    private $entityManager;\n+\n+    /**\n+     * @var FindSpeakerByUuidInterface|\\PHPUnit_Framework_MockObject_MockObject\n+     */\n+    private $findSpeaker;\n+\n+    /**\n+     * @var EditSpeakerAction\n+     */\n+    private $action;\n+\n+    public function setUp()\n+    {\n+        $this->speaker = Speaker::fromNameAndTwitter(\n+            'Foo Bar',\n+            'foobar'\n+        );\n+\n+        $this->form = $this->createMock(FormInterface::class);\n+        $this->renderer = $this->createMock(TemplateRendererInterface::class);\n+        $this->urlHelper = $this->createMock(UrlHelper::class);\n+        $this->entityManager = $this->createMock(EntityManagerInterface::class);\n+        $this->findSpeaker = $this->createMock(FindSpeakerByUuidInterface::class);\n+        $this->findSpeaker->expects(self::once())\n+            ->method('__invoke')\n+            ->with($this->speaker->getId())\n+            ->willReturn($this->speaker);\n+\n+        $this->action = new EditSpeakerAction(\n+            $this->renderer,\n+            $this->findSpeaker,\n+            $this->form,\n+            $this->entityManager,\n+            $this->urlHelper\n+        );\n+    }\n+\n+    public function testGetRequestRendersTemplate()\n+    {\n+        $this->form->expects(self::once())->method('setData');\n+        $this->form->expects(self::never())->method('isValid');\n+        $this->form->expects(self::never())->method('getData');\n+\n+        $this->renderer->expects(self::once())->method('render')->with('account::speaker/edit', [\n+            'title' => 'Edit speaker',\n+            'form' => $this->form,\n+        ])->willReturn('content...');\n+\n+        $this->urlHelper->expects(self::never())->method('generate');\n+\n+        $this->entityManager->expects(self::never())->method('transactional');\n+\n+        $response = $this->action->__invoke(\n+            (new ServerRequest(['/']))\n+                ->withMethod('GET')\n+                ->withAttribute('uuid', $this->speaker->getId()),\n+            new Response()\n+        );\n+\n+        self::assertInstanceOf(Response\\HtmlResponse::class, $response);\n+        self::assertSame('content...', (string)$response->getBody());\n+    }\n+\n+    public function testInvalidPostRequestRendersTemplate()\n+    {\n+        $this->renderer->expects(self::once())\n+            ->method('render')\n+            ->with('account::speaker/edit')\n+            ->willReturn('content...');\n+\n+        $this->urlHelper->expects(self::never())->method('generate');\n+\n+        $this->form->expects(self::exactly(2))->method('setData');\n+        $this->form->expects(self::once())->method('isValid')->willReturn(false);\n+        $this->form->expects(self::never())->method('getData');\n+\n+        $this->entityManager->expects(self::never())->method('transactional');\n+\n+        $response = $this->action->__invoke(\n+            (new ServerRequest(['/']))\n+                ->withMethod('post')\n+                ->withAttribute('uuid', $this->speaker->getId())\n+                ->withParsedBody([\n+                    'name' => '',\n+                    'twitter' => '',\n+                ]),\n+            new Response()\n+        );\n+\n+        self::assertInstanceOf(Response\\HtmlResponse::class, $response);\n+        self::assertSame('content...', (string)$response->getBody());\n+    }\n+\n+    public function testValidPostRequestCreatesMeetupAndPersists()","path":"test/AppTest/Action/Account/Speaker/EditSpeakerActionTest.php","position":138,"original_position":138,"commit_id":"58212002657bea539defa18c1fe61cf2760ab4b8","original_commit_id":"58212002657bea539defa18c1fe61cf2760ab4b8","user":{"login":"lboynton","id":98873,"avatar_url":"https://avatars.githubusercontent.com/u/98873?v=3","gravatar_id":"","url":"https://api.github.com/users/lboynton","html_url":"https://github.com/lboynton","followers_url":"https://api.github.com/users/lboynton/followers","following_url":"https://api.github.com/users/lboynton/following{/other_user}","gists_url":"https://api.github.com/users/lboynton/gists{/gist_id}","starred_url":"https://api.github.com/users/lboynton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lboynton/subscriptions","organizations_url":"https://api.github.com/users/lboynton/orgs","repos_url":"https://api.github.com/users/lboynton/repos","events_url":"https://api.github.com/users/lboynton/events{/privacy}","received_events_url":"https://api.github.com/users/lboynton/received_events","type":"User","site_admin":false},"body":"`testValidPostRequestUpdatesSpeakerAndPersists()`","created_at":"2016-10-18T19:52:11Z","updated_at":"2016-10-18T19:54:55Z","html_url":"https://github.com/phphants/phph-site/pull/130#discussion_r83936320","pull_request_url":"https://api.github.com/repos/phphants/phph-site/pulls/130","_links":{"self":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/comments/83936320"},"html":{"href":"https://github.com/phphants/phph-site/pull/130#discussion_r83936320"},"pull_request":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/130"}}},"pull_request":{"url":"https://api.github.com/repos/phphants/phph-site/pulls/130","id":88872257,"html_url":"https://github.com/phphants/phph-site/pull/130","diff_url":"https://github.com/phphants/phph-site/pull/130.diff","patch_url":"https://github.com/phphants/phph-site/pull/130.patch","issue_url":"https://api.github.com/repos/phphants/phph-site/issues/130","number":130,"state":"open","locked":false,"title":"Speaker management interface","user":{"login":"asgrim","id":496145,"avatar_url":"https://avatars.githubusercontent.com/u/496145?v=3","gravatar_id":"","url":"https://api.github.com/users/asgrim","html_url":"https://github.com/asgrim","followers_url":"https://api.github.com/users/asgrim/followers","following_url":"https://api.github.com/users/asgrim/following{/other_user}","gists_url":"https://api.github.com/users/asgrim/gists{/gist_id}","starred_url":"https://api.github.com/users/asgrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asgrim/subscriptions","organizations_url":"https://api.github.com/users/asgrim/orgs","repos_url":"https://api.github.com/users/asgrim/repos","events_url":"https://api.github.com/users/asgrim/events{/privacy}","received_events_url":"https://api.github.com/users/asgrim/received_events","type":"User","site_admin":false},"body":"Fixes #104 ","created_at":"2016-10-11T17:07:46Z","updated_at":"2016-10-18T19:54:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f14ff3abbf8298e1c5ee44b1766a725695c5dfcd","assignee":{"login":"lboynton","id":98873,"avatar_url":"https://avatars.githubusercontent.com/u/98873?v=3","gravatar_id":"","url":"https://api.github.com/users/lboynton","html_url":"https://github.com/lboynton","followers_url":"https://api.github.com/users/lboynton/followers","following_url":"https://api.github.com/users/lboynton/following{/other_user}","gists_url":"https://api.github.com/users/lboynton/gists{/gist_id}","starred_url":"https://api.github.com/users/lboynton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lboynton/subscriptions","organizations_url":"https://api.github.com/users/lboynton/orgs","repos_url":"https://api.github.com/users/lboynton/repos","events_url":"https://api.github.com/users/lboynton/events{/privacy}","received_events_url":"https://api.github.com/users/lboynton/received_events","type":"User","site_admin":false},"assignees":[{"login":"lboynton","id":98873,"avatar_url":"https://avatars.githubusercontent.com/u/98873?v=3","gravatar_id":"","url":"https://api.github.com/users/lboynton","html_url":"https://github.com/lboynton","followers_url":"https://api.github.com/users/lboynton/followers","following_url":"https://api.github.com/users/lboynton/following{/other_user}","gists_url":"https://api.github.com/users/lboynton/gists{/gist_id}","starred_url":"https://api.github.com/users/lboynton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lboynton/subscriptions","organizations_url":"https://api.github.com/users/lboynton/orgs","repos_url":"https://api.github.com/users/lboynton/repos","events_url":"https://api.github.com/users/lboynton/events{/privacy}","received_events_url":"https://api.github.com/users/lboynton/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/phphants/phph-site/pulls/130/commits","review_comments_url":"https://api.github.com/repos/phphants/phph-site/pulls/130/comments","review_comment_url":"https://api.github.com/repos/phphants/phph-site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phphants/phph-site/issues/130/comments","statuses_url":"https://api.github.com/repos/phphants/phph-site/statuses/58212002657bea539defa18c1fe61cf2760ab4b8","head":{"label":"phphants:speaker-management-interface","ref":"speaker-management-interface","sha":"58212002657bea539defa18c1fe61cf2760ab4b8","user":{"login":"phphants","id":2431438,"avatar_url":"https://avatars.githubusercontent.com/u/2431438?v=3","gravatar_id":"","url":"https://api.github.com/users/phphants","html_url":"https://github.com/phphants","followers_url":"https://api.github.com/users/phphants/followers","following_url":"https://api.github.com/users/phphants/following{/other_user}","gists_url":"https://api.github.com/users/phphants/gists{/gist_id}","starred_url":"https://api.github.com/users/phphants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phphants/subscriptions","organizations_url":"https://api.github.com/users/phphants/orgs","repos_url":"https://api.github.com/users/phphants/repos","events_url":"https://api.github.com/users/phphants/events{/privacy}","received_events_url":"https://api.github.com/users/phphants/received_events","type":"Organization","site_admin":false},"repo":{"id":5979096,"name":"phph-site","full_name":"phphants/phph-site","owner":{"login":"phphants","id":2431438,"avatar_url":"https://avatars.githubusercontent.com/u/2431438?v=3","gravatar_id":"","url":"https://api.github.com/users/phphants","html_url":"https://github.com/phphants","followers_url":"https://api.github.com/users/phphants/followers","following_url":"https://api.github.com/users/phphants/following{/other_user}","gists_url":"https://api.github.com/users/phphants/gists{/gist_id}","starred_url":"https://api.github.com/users/phphants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phphants/subscriptions","organizations_url":"https://api.github.com/users/phphants/orgs","repos_url":"https://api.github.com/users/phphants/repos","events_url":"https://api.github.com/users/phphants/events{/privacy}","received_events_url":"https://api.github.com/users/phphants/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phphants/phph-site","description":"Website for www.phphants.co.uk","fork":false,"url":"https://api.github.com/repos/phphants/phph-site","forks_url":"https://api.github.com/repos/phphants/phph-site/forks","keys_url":"https://api.github.com/repos/phphants/phph-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phphants/phph-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phphants/phph-site/teams","hooks_url":"https://api.github.com/repos/phphants/phph-site/hooks","issue_events_url":"https://api.github.com/repos/phphants/phph-site/issues/events{/number}","events_url":"https://api.github.com/repos/phphants/phph-site/events","assignees_url":"https://api.github.com/repos/phphants/phph-site/assignees{/user}","branches_url":"https://api.github.com/repos/phphants/phph-site/branches{/branch}","tags_url":"https://api.github.com/repos/phphants/phph-site/tags","blobs_url":"https://api.github.com/repos/phphants/phph-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phphants/phph-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phphants/phph-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/phphants/phph-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phphants/phph-site/statuses/{sha}","languages_url":"https://api.github.com/repos/phphants/phph-site/languages","stargazers_url":"https://api.github.com/repos/phphants/phph-site/stargazers","contributors_url":"https://api.github.com/repos/phphants/phph-site/contributors","subscribers_url":"https://api.github.com/repos/phphants/phph-site/subscribers","subscription_url":"https://api.github.com/repos/phphants/phph-site/subscription","commits_url":"https://api.github.com/repos/phphants/phph-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/phphants/phph-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/phphants/phph-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/phphants/phph-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/phphants/phph-site/contents/{+path}","compare_url":"https://api.github.com/repos/phphants/phph-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phphants/phph-site/merges","archive_url":"https://api.github.com/repos/phphants/phph-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phphants/phph-site/downloads","issues_url":"https://api.github.com/repos/phphants/phph-site/issues{/number}","pulls_url":"https://api.github.com/repos/phphants/phph-site/pulls{/number}","milestones_url":"https://api.github.com/repos/phphants/phph-site/milestones{/number}","notifications_url":"https://api.github.com/repos/phphants/phph-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phphants/phph-site/labels{/name}","releases_url":"https://api.github.com/repos/phphants/phph-site/releases{/id}","deployments_url":"https://api.github.com/repos/phphants/phph-site/deployments","created_at":"2012-09-27T08:05:18Z","updated_at":"2016-08-15T13:20:52Z","pushed_at":"2016-10-13T12:46:49Z","git_url":"git://github.com/phphants/phph-site.git","ssh_url":"git@github.com:phphants/phph-site.git","clone_url":"https://github.com/phphants/phph-site.git","svn_url":"https://github.com/phphants/phph-site","homepage":null,"size":1490,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":15,"forks":5,"open_issues":15,"watchers":7,"default_branch":"master"}},"base":{"label":"phphants:master","ref":"master","sha":"cd18fbe47751c9ec57230861b69369b4871da491","user":{"login":"phphants","id":2431438,"avatar_url":"https://avatars.githubusercontent.com/u/2431438?v=3","gravatar_id":"","url":"https://api.github.com/users/phphants","html_url":"https://github.com/phphants","followers_url":"https://api.github.com/users/phphants/followers","following_url":"https://api.github.com/users/phphants/following{/other_user}","gists_url":"https://api.github.com/users/phphants/gists{/gist_id}","starred_url":"https://api.github.com/users/phphants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phphants/subscriptions","organizations_url":"https://api.github.com/users/phphants/orgs","repos_url":"https://api.github.com/users/phphants/repos","events_url":"https://api.github.com/users/phphants/events{/privacy}","received_events_url":"https://api.github.com/users/phphants/received_events","type":"Organization","site_admin":false},"repo":{"id":5979096,"name":"phph-site","full_name":"phphants/phph-site","owner":{"login":"phphants","id":2431438,"avatar_url":"https://avatars.githubusercontent.com/u/2431438?v=3","gravatar_id":"","url":"https://api.github.com/users/phphants","html_url":"https://github.com/phphants","followers_url":"https://api.github.com/users/phphants/followers","following_url":"https://api.github.com/users/phphants/following{/other_user}","gists_url":"https://api.github.com/users/phphants/gists{/gist_id}","starred_url":"https://api.github.com/users/phphants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phphants/subscriptions","organizations_url":"https://api.github.com/users/phphants/orgs","repos_url":"https://api.github.com/users/phphants/repos","events_url":"https://api.github.com/users/phphants/events{/privacy}","received_events_url":"https://api.github.com/users/phphants/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phphants/phph-site","description":"Website for www.phphants.co.uk","fork":false,"url":"https://api.github.com/repos/phphants/phph-site","forks_url":"https://api.github.com/repos/phphants/phph-site/forks","keys_url":"https://api.github.com/repos/phphants/phph-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phphants/phph-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phphants/phph-site/teams","hooks_url":"https://api.github.com/repos/phphants/phph-site/hooks","issue_events_url":"https://api.github.com/repos/phphants/phph-site/issues/events{/number}","events_url":"https://api.github.com/repos/phphants/phph-site/events","assignees_url":"https://api.github.com/repos/phphants/phph-site/assignees{/user}","branches_url":"https://api.github.com/repos/phphants/phph-site/branches{/branch}","tags_url":"https://api.github.com/repos/phphants/phph-site/tags","blobs_url":"https://api.github.com/repos/phphants/phph-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phphants/phph-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phphants/phph-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/phphants/phph-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phphants/phph-site/statuses/{sha}","languages_url":"https://api.github.com/repos/phphants/phph-site/languages","stargazers_url":"https://api.github.com/repos/phphants/phph-site/stargazers","contributors_url":"https://api.github.com/repos/phphants/phph-site/contributors","subscribers_url":"https://api.github.com/repos/phphants/phph-site/subscribers","subscription_url":"https://api.github.com/repos/phphants/phph-site/subscription","commits_url":"https://api.github.com/repos/phphants/phph-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/phphants/phph-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/phphants/phph-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/phphants/phph-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/phphants/phph-site/contents/{+path}","compare_url":"https://api.github.com/repos/phphants/phph-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phphants/phph-site/merges","archive_url":"https://api.github.com/repos/phphants/phph-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phphants/phph-site/downloads","issues_url":"https://api.github.com/repos/phphants/phph-site/issues{/number}","pulls_url":"https://api.github.com/repos/phphants/phph-site/pulls{/number}","milestones_url":"https://api.github.com/repos/phphants/phph-site/milestones{/number}","notifications_url":"https://api.github.com/repos/phphants/phph-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phphants/phph-site/labels{/name}","releases_url":"https://api.github.com/repos/phphants/phph-site/releases{/id}","deployments_url":"https://api.github.com/repos/phphants/phph-site/deployments","created_at":"2012-09-27T08:05:18Z","updated_at":"2016-08-15T13:20:52Z","pushed_at":"2016-10-13T12:46:49Z","git_url":"git://github.com/phphants/phph-site.git","ssh_url":"git@github.com:phphants/phph-site.git","clone_url":"https://github.com/phphants/phph-site.git","svn_url":"https://github.com/phphants/phph-site","homepage":null,"size":1490,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":15,"forks":5,"open_issues":15,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/130"},"html":{"href":"https://github.com/phphants/phph-site/pull/130"},"issue":{"href":"https://api.github.com/repos/phphants/phph-site/issues/130"},"comments":{"href":"https://api.github.com/repos/phphants/phph-site/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phphants/phph-site/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/phphants/phph-site/statuses/58212002657bea539defa18c1fe61cf2760ab4b8"}}}}
{"actor":{"display_login":"lboynton"}}