{"action":"created","comment":{"url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/comments/84894095","pull_request_review_id":5638925,"id":84894095,"diff_hunk":"@@ -0,0 +1,78 @@\n+<?php\n+\n+namespace OpenClassrooms\\FrontDesk\\Repository;\n+\n+use Carbon\\Carbon;\n+use OpenClassrooms\\FrontDesk\\Doubles\\Client\\Impl\\ApiClientMock;\n+use OpenClassrooms\\FrontDesk\\Doubles\\Models\\PersonStub1;\n+use OpenClassrooms\\FrontDesk\\Doubles\\Models\\VisitStub1;\n+\n+/**\n+ * @author Killian Herbunot <killian.herbunot@openclassrooms.com>\n+ */\n+class VisitRepositoryTest extends \\PHPUnit_Framework_TestCase\n+{\n+    const FROM = \"2016-08-12 15:30:06\";\n+\n+    const TO = \"2016-09-12 15:30:06\";\n+\n+    /**\n+     * @var VisitRepository\n+     */\n+    private $visitRepository;\n+\n+    /**\n+     * @test\n+     *\n+     * @expectedException \\OpenClassrooms\\FrontDesk\\Services\\Impl\\InvalidTotalCountException\n+     */\n+    public function checkTotalCount()\n+    {\n+        ApiClientMock::$response = json_encode([\"visits\" => [new VisitStub1()], \"total_count\" => 0]);\n+\n+        $this->visitRepository->findAllByPersonId(PersonStub1::ID);\n+    }\n+\n+    /**\n+     * @test\n+     */\n+    public function findAllByPersonIdWithoutParameters_ReturnVisits()\n+    {\n+        ApiClientMock::$response = json_encode([\"visits\" => [new VisitStub1()], \"total_count\" => 1]);\n+\n+        $visits = $this->visitRepository->findAllByPersonId(PersonStub1::ID);\n+        $this->assertEquals(json_encode([new VisitStub1()]), json_encode($visits));","path":"tests/Repository/VisitRepositoryTest.php","position":44,"original_position":44,"commit_id":"514c8a24ff701d664416d46281ce87dcde74aa7e","original_commit_id":"514c8a24ff701d664416d46281ce87dcde74aa7e","user":{"login":"arnaud-23","id":2587655,"avatar_url":"https://avatars.githubusercontent.com/u/2587655?v=3","gravatar_id":"","url":"https://api.github.com/users/arnaud-23","html_url":"https://github.com/arnaud-23","followers_url":"https://api.github.com/users/arnaud-23/followers","following_url":"https://api.github.com/users/arnaud-23/following{/other_user}","gists_url":"https://api.github.com/users/arnaud-23/gists{/gist_id}","starred_url":"https://api.github.com/users/arnaud-23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnaud-23/subscriptions","organizations_url":"https://api.github.com/users/arnaud-23/orgs","repos_url":"https://api.github.com/users/arnaud-23/repos","events_url":"https://api.github.com/users/arnaud-23/events{/privacy}","received_events_url":"https://api.github.com/users/arnaud-23/received_events","type":"User","site_admin":false},"body":"what about the use of the assertVisit in VisitTestCase trait ?","created_at":"2016-10-25T12:51:42Z","updated_at":"2016-10-25T12:55:34Z","html_url":"https://github.com/OpenClassrooms/FrontDesk/pull/6#discussion_r84894095","pull_request_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/comments/84894095"},"html":{"href":"https://github.com/OpenClassrooms/FrontDesk/pull/6#discussion_r84894095"},"pull_request":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6","id":90575169,"html_url":"https://github.com/OpenClassrooms/FrontDesk/pull/6","diff_url":"https://github.com/OpenClassrooms/FrontDesk/pull/6.diff","patch_url":"https://github.com/OpenClassrooms/FrontDesk/pull/6.patch","issue_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/6","number":6,"state":"open","locked":false,"title":"Get visit service","user":{"login":"killianherbunot","id":10085296,"avatar_url":"https://avatars.githubusercontent.com/u/10085296?v=3","gravatar_id":"","url":"https://api.github.com/users/killianherbunot","html_url":"https://github.com/killianherbunot","followers_url":"https://api.github.com/users/killianherbunot/followers","following_url":"https://api.github.com/users/killianherbunot/following{/other_user}","gists_url":"https://api.github.com/users/killianherbunot/gists{/gist_id}","starred_url":"https://api.github.com/users/killianherbunot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/killianherbunot/subscriptions","organizations_url":"https://api.github.com/users/killianherbunot/orgs","repos_url":"https://api.github.com/users/killianherbunot/repos","events_url":"https://api.github.com/users/killianherbunot/events{/privacy}","received_events_url":"https://api.github.com/users/killianherbunot/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-24T09:17:21Z","updated_at":"2016-10-25T12:55:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d273b27e41db5f5029049c7d8129ea875ac6512","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6/commits","review_comments_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6/comments","review_comment_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/6/comments","statuses_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/statuses/514c8a24ff701d664416d46281ce87dcde74aa7e","head":{"label":"OpenClassrooms:get_visit_service","ref":"get_visit_service","sha":"514c8a24ff701d664416d46281ce87dcde74aa7e","user":{"login":"OpenClassrooms","id":5389533,"avatar_url":"https://avatars.githubusercontent.com/u/5389533?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenClassrooms","html_url":"https://github.com/OpenClassrooms","followers_url":"https://api.github.com/users/OpenClassrooms/followers","following_url":"https://api.github.com/users/OpenClassrooms/following{/other_user}","gists_url":"https://api.github.com/users/OpenClassrooms/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenClassrooms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenClassrooms/subscriptions","organizations_url":"https://api.github.com/users/OpenClassrooms/orgs","repos_url":"https://api.github.com/users/OpenClassrooms/repos","events_url":"https://api.github.com/users/OpenClassrooms/events{/privacy}","received_events_url":"https://api.github.com/users/OpenClassrooms/received_events","type":"Organization","site_admin":false},"repo":{"id":69547650,"name":"FrontDesk","full_name":"OpenClassrooms/FrontDesk","owner":{"login":"OpenClassrooms","id":5389533,"avatar_url":"https://avatars.githubusercontent.com/u/5389533?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenClassrooms","html_url":"https://github.com/OpenClassrooms","followers_url":"https://api.github.com/users/OpenClassrooms/followers","following_url":"https://api.github.com/users/OpenClassrooms/following{/other_user}","gists_url":"https://api.github.com/users/OpenClassrooms/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenClassrooms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenClassrooms/subscriptions","organizations_url":"https://api.github.com/users/OpenClassrooms/orgs","repos_url":"https://api.github.com/users/OpenClassrooms/repos","events_url":"https://api.github.com/users/OpenClassrooms/events{/privacy}","received_events_url":"https://api.github.com/users/OpenClassrooms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenClassrooms/FrontDesk","description":null,"fork":false,"url":"https://api.github.com/repos/OpenClassrooms/FrontDesk","forks_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/forks","keys_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/teams","hooks_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/hooks","issue_events_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/events{/number}","events_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/events","assignees_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/assignees{/user}","branches_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/branches{/branch}","tags_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/tags","blobs_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/languages","stargazers_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/stargazers","contributors_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/contributors","subscribers_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/subscribers","subscription_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/subscription","commits_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/contents/{+path}","compare_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/merges","archive_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/downloads","issues_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues{/number}","pulls_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/labels{/name}","releases_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/releases{/id}","deployments_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/deployments","created_at":"2016-09-29T08:32:22Z","updated_at":"2016-10-05T14:59:59Z","pushed_at":"2016-10-25T12:29:16Z","git_url":"git://github.com/OpenClassrooms/FrontDesk.git","ssh_url":"git@github.com:OpenClassrooms/FrontDesk.git","clone_url":"https://github.com/OpenClassrooms/FrontDesk.git","svn_url":"https://github.com/OpenClassrooms/FrontDesk","homepage":null,"size":58,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenClassrooms:master","ref":"master","sha":"2a337748ea9d360e128b4b1e8b0bc28052df48cd","user":{"login":"OpenClassrooms","id":5389533,"avatar_url":"https://avatars.githubusercontent.com/u/5389533?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenClassrooms","html_url":"https://github.com/OpenClassrooms","followers_url":"https://api.github.com/users/OpenClassrooms/followers","following_url":"https://api.github.com/users/OpenClassrooms/following{/other_user}","gists_url":"https://api.github.com/users/OpenClassrooms/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenClassrooms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenClassrooms/subscriptions","organizations_url":"https://api.github.com/users/OpenClassrooms/orgs","repos_url":"https://api.github.com/users/OpenClassrooms/repos","events_url":"https://api.github.com/users/OpenClassrooms/events{/privacy}","received_events_url":"https://api.github.com/users/OpenClassrooms/received_events","type":"Organization","site_admin":false},"repo":{"id":69547650,"name":"FrontDesk","full_name":"OpenClassrooms/FrontDesk","owner":{"login":"OpenClassrooms","id":5389533,"avatar_url":"https://avatars.githubusercontent.com/u/5389533?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenClassrooms","html_url":"https://github.com/OpenClassrooms","followers_url":"https://api.github.com/users/OpenClassrooms/followers","following_url":"https://api.github.com/users/OpenClassrooms/following{/other_user}","gists_url":"https://api.github.com/users/OpenClassrooms/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenClassrooms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenClassrooms/subscriptions","organizations_url":"https://api.github.com/users/OpenClassrooms/orgs","repos_url":"https://api.github.com/users/OpenClassrooms/repos","events_url":"https://api.github.com/users/OpenClassrooms/events{/privacy}","received_events_url":"https://api.github.com/users/OpenClassrooms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenClassrooms/FrontDesk","description":null,"fork":false,"url":"https://api.github.com/repos/OpenClassrooms/FrontDesk","forks_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/forks","keys_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/teams","hooks_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/hooks","issue_events_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/events{/number}","events_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/events","assignees_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/assignees{/user}","branches_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/branches{/branch}","tags_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/tags","blobs_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/languages","stargazers_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/stargazers","contributors_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/contributors","subscribers_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/subscribers","subscription_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/subscription","commits_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/contents/{+path}","compare_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/merges","archive_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/downloads","issues_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues{/number}","pulls_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/labels{/name}","releases_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/releases{/id}","deployments_url":"https://api.github.com/repos/OpenClassrooms/FrontDesk/deployments","created_at":"2016-09-29T08:32:22Z","updated_at":"2016-10-05T14:59:59Z","pushed_at":"2016-10-25T12:29:16Z","git_url":"git://github.com/OpenClassrooms/FrontDesk.git","ssh_url":"git@github.com:OpenClassrooms/FrontDesk.git","clone_url":"https://github.com/OpenClassrooms/FrontDesk.git","svn_url":"https://github.com/OpenClassrooms/FrontDesk","homepage":null,"size":58,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6"},"html":{"href":"https://github.com/OpenClassrooms/FrontDesk/pull/6"},"issue":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/6"},"comments":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/OpenClassrooms/FrontDesk/statuses/514c8a24ff701d664416d46281ce87dcde74aa7e"}}}}
{"actor":{"display_login":"arnaud-23"}}