{"action":"created","comment":{"url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/comments/48582506","id":48582506,"diff_hunk":"@@ -0,0 +1,108 @@\n+<?php\n+\n+use Illuminate\\Foundation\\Testing\\WithoutMiddleware;\n+use Illuminate\\Foundation\\Testing\\DatabaseMigrations;\n+use Illuminate\\Foundation\\Testing\\DatabaseTransactions;\n+\n+class ApiVerhuurTest extends TestCase\n+{\n+    use WithoutMiddleware, DatabaseTransactions, DatabaseMigrations;\n+\n+    /**\n+     * @group rental\n+     * @group all\n+     * @group api\n+     */\n+    public function testApiRentalIndex()\n+    {\n+        factory(App\\Verhuring::class, 1)->create([\n+            'id' => 1,\n+            'Email' => 'test@domain.be',\n+        ]);\n+\n+        $response = $this->call('GET', '/api/v1/verhuring');\n+        $array = json_decode($response->getContent(), true);\n+\n+        $this->assertNotEmpty($array);\n+        $this->assertEquals(200, $response->getStatusCode());\n+        $this->assertTrue(sizeof($array) > 0);\n+\n+        $dataInfo = $array['data'][0];\n+        $dataDate = $array['data'][0]['datum'];\n+\n+        $this->assertArrayHasKey('id', $dataInfo);\n+        $this->assertArrayhasKey('status', $dataInfo);\n+\n+        $this->assertArrayHasKey('start', $dataDate);\n+        $this->assertArrayHasKey('eind', $dataDate);\n+    }\n+\n+    /**\n+     * @group rental\n+     * @group all\n+     * @group api\n+     */\n+    public function testApiRentalSpecific()\n+    {\n+        $rental = factory(App\\Verhuring::class, 1)->create([\n+            'id' => 1,\n+            'Email' => 'test@domain.be',\n+        ]);\n+\n+        $response = $this->call('GET', '/api/v1/verhuring/'. $rental->id);\n+        $array = json_decode($response->getContent(), true);\n+\n+        $this->assertNotEmpty($array);\n+        $this->assertEquals(200, $response->getStatusCode());\n+        $this->assertTrue(sizeof($array) > 0);\n+\n+        $dataInfo = $array['data'][0];\n+        $dataDate = $array['data'][0]['datum'];\n+\n+        $this->assertArrayHasKey('id', $dataInfo);\n+        $this->assertArrayhasKey('status', $dataInfo);\n+\n+        $this->assertArrayHasKey('start', $dataDate);\n+        $this->assertArrayHasKey('eind', $dataDate);\n+\n+        // Test when no data will be returned.\n+        $responseTwo = $this->call('GET', '/api/v1/verhuring/5');\n+        $arrayTwo = json_decode($responseTwo->getContent(), true);\n+\n+        $this->assertNotEmpty($arrayTwo);\n+        $this->assertArrayHasKey('errors', $arrayTwo);\n+        $this->assertArrayHasKey('message', $arrayTwo['errors'][0]);\n+\n+    }\n+\n+    /**\n+     * @group rental\n+     * @group all\n+     * @group api\n+     */\n+    public function testApiRentalInsert()\n+    {\n+        $rental = factory(App\\Verhuring::class, 1)->create();\n+\n+        $data['StartDatum'] = '11-12-2016';\n+        $data['EindDatum']  = '10-10-2016';\n+        $data['Groep']      = 'ScoutsGroep';\n+        $data['Email']      = 'DOmain@example.com';\n+        $data['Gsm']        = '0474853880';\n+\n+        // Database Validation.\n+        $Database['Start_Datum'] = $data['StartDatum'];\n+        $Database['Eind_datum']  = $data['EindDatum'];\n+        $Database['Groep']       = $data['Groep'];\n+        $Database['Email']       = $data['Email'];\n+        $Database['Status']      = 0;\n+        $Database['GSM']         = $data['Gsm'];\n+\n+        $this->post('/api/v1/verhuring', $data)\n+            ->seeJson($data)\n+            ->seeInDatabase('Verhuur', $Database)\n+            ->seeStatusCode(200)\n+            ->seeStatusCode(200);\n+    }\n+\n+}","path":"tests/ApiVerhuurTest.php","position":108,"original_position":108,"commit_id":"3d391ec7dd1cff605262151c625905f5ace4f891","original_commit_id":"3d391ec7dd1cff605262151c625905f5ace4f891","user":{"login":"Nitpick-CI","id":12626182,"avatar_url":"https://avatars.githubusercontent.com/u/12626182?v=3","gravatar_id":"","url":"https://api.github.com/users/Nitpick-CI","html_url":"https://github.com/Nitpick-CI","followers_url":"https://api.github.com/users/Nitpick-CI/followers","following_url":"https://api.github.com/users/Nitpick-CI/following{/other_user}","gists_url":"https://api.github.com/users/Nitpick-CI/gists{/gist_id}","starred_url":"https://api.github.com/users/Nitpick-CI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nitpick-CI/subscriptions","organizations_url":"https://api.github.com/users/Nitpick-CI/orgs","repos_url":"https://api.github.com/users/Nitpick-CI/repos","events_url":"https://api.github.com/users/Nitpick-CI/events{/privacy}","received_events_url":"https://api.github.com/users/Nitpick-CI/received_events","type":"User","site_admin":false},"body":"The closing brace for the class must go on the next line after the body","created_at":"2015-12-30T01:16:17Z","updated_at":"2015-12-30T01:16:17Z","html_url":"https://github.com/SIJOT/SIJOT-2.x/pull/174#discussion_r48582506","pull_request_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174","_links":{"self":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/comments/48582506"},"html":{"href":"https://github.com/SIJOT/SIJOT-2.x/pull/174#discussion_r48582506"},"pull_request":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174"}}},"pull_request":{"url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174","id":54654127,"html_url":"https://github.com/SIJOT/SIJOT-2.x/pull/174","diff_url":"https://github.com/SIJOT/SIJOT-2.x/pull/174.diff","patch_url":"https://github.com/SIJOT/SIJOT-2.x/pull/174.patch","issue_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/174","number":174,"state":"open","locked":false,"title":"API Implementation","user":{"login":"Tjoosten","id":5157609,"avatar_url":"https://avatars.githubusercontent.com/u/5157609?v=3","gravatar_id":"","url":"https://api.github.com/users/Tjoosten","html_url":"https://github.com/Tjoosten","followers_url":"https://api.github.com/users/Tjoosten/followers","following_url":"https://api.github.com/users/Tjoosten/following{/other_user}","gists_url":"https://api.github.com/users/Tjoosten/gists{/gist_id}","starred_url":"https://api.github.com/users/Tjoosten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tjoosten/subscriptions","organizations_url":"https://api.github.com/users/Tjoosten/orgs","repos_url":"https://api.github.com/users/Tjoosten/repos","events_url":"https://api.github.com/users/Tjoosten/events{/privacy}","received_events_url":"https://api.github.com/users/Tjoosten/received_events","type":"User","site_admin":false},"body":"# PR `#174` - API implementation\r\n\r\nThis PR *`#174`* will allow the user's using an API. So the `rental`, `user`, `activities`, data can be used in multiple platforms. The data will be given based on permission of the request user. There is also a clear file in the documentation. (`/docs/` folder in the repo).\r\n\r\n## Commits: \r\n\r\n- e657bdf Add rental Index api method\r\n- ad41b05 Add phpunit's coverage directory to the `.gitignore`.\r\n- ceed4f5 Add the fractal library to the composer file. \r\n- 8bdb7e6 Add method to display a specific rental item.\r\n- edb8046 Add database check method for the rental insert. \r\n- 883f01b Add rental insert method.\r\n- 3e5968b Add the rental testing group to the testing methods.\r\n\r\n## TODO:\r\n\r\n#### Rental\r\n- [ ] Add rental delete method. \r\n- [ ] Add user index method. \r\n- [ ] Add user update method. \r\n- [ ] Add user specific show method.\r\n- [ ] Add user delete method. \r\n- [ ] Add activities index method. \r\n- [ ] Add activities update method. \r\n- [ ] Add activities specific show method.\r\n- [ ] Add activities delete method. \r\n- [ ] Fix nit-pick PSR issues.\r\n- [ ] Add API throttling.\r\n\r\n## Note(s):\r\n\r\n### TravisCI - Integration testing:\r\n\r\nThe tests on GitHub are failing because a invalid CSS query. But this PR can be merged with this error. Because the error is not in the API testing methods. ","created_at":"2015-12-28T13:10:25Z","updated_at":"2015-12-30T01:16:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c56e45d70a4d91be522748e20775dc8e7dc9642d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174/commits","review_comments_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174/comments","review_comment_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/174/comments","statuses_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/statuses/3d391ec7dd1cff605262151c625905f5ace4f891","head":{"label":"SIJOT:API","ref":"API","sha":"3d391ec7dd1cff605262151c625905f5ace4f891","user":{"login":"SIJOT","id":16041196,"avatar_url":"https://avatars.githubusercontent.com/u/16041196?v=3","gravatar_id":"","url":"https://api.github.com/users/SIJOT","html_url":"https://github.com/SIJOT","followers_url":"https://api.github.com/users/SIJOT/followers","following_url":"https://api.github.com/users/SIJOT/following{/other_user}","gists_url":"https://api.github.com/users/SIJOT/gists{/gist_id}","starred_url":"https://api.github.com/users/SIJOT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SIJOT/subscriptions","organizations_url":"https://api.github.com/users/SIJOT/orgs","repos_url":"https://api.github.com/users/SIJOT/repos","events_url":"https://api.github.com/users/SIJOT/events{/privacy}","received_events_url":"https://api.github.com/users/SIJOT/received_events","type":"Organization","site_admin":false},"repo":{"id":45360682,"name":"SIJOT-2.x","full_name":"SIJOT/SIJOT-2.x","owner":{"login":"SIJOT","id":16041196,"avatar_url":"https://avatars.githubusercontent.com/u/16041196?v=3","gravatar_id":"","url":"https://api.github.com/users/SIJOT","html_url":"https://github.com/SIJOT","followers_url":"https://api.github.com/users/SIJOT/followers","following_url":"https://api.github.com/users/SIJOT/following{/other_user}","gists_url":"https://api.github.com/users/SIJOT/gists{/gist_id}","starred_url":"https://api.github.com/users/SIJOT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SIJOT/subscriptions","organizations_url":"https://api.github.com/users/SIJOT/orgs","repos_url":"https://api.github.com/users/SIJOT/repos","events_url":"https://api.github.com/users/SIJOT/events{/privacy}","received_events_url":"https://api.github.com/users/SIJOT/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SIJOT/SIJOT-2.x","description":"[Under development] SIJOT platform","fork":false,"url":"https://api.github.com/repos/SIJOT/SIJOT-2.x","forks_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/forks","keys_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/teams","hooks_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/hooks","issue_events_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/events{/number}","events_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/events","assignees_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/assignees{/user}","branches_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/branches{/branch}","tags_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/tags","blobs_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/refs{/sha}","trees_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/statuses/{sha}","languages_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/languages","stargazers_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/stargazers","contributors_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/contributors","subscribers_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/subscribers","subscription_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/subscription","commits_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/commits{/sha}","git_commits_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/commits{/sha}","comments_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/comments{/number}","issue_comment_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/comments{/number}","contents_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/contents/{+path}","compare_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/merges","archive_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/downloads","issues_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues{/number}","pulls_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls{/number}","milestones_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/milestones{/number}","notifications_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/labels{/name}","releases_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/releases{/id}","created_at":"2015-11-01T22:43:48Z","updated_at":"2015-12-13T01:28:07Z","pushed_at":"2015-12-30T01:16:13Z","git_url":"git://github.com/SIJOT/SIJOT-2.x.git","ssh_url":"git@github.com:SIJOT/SIJOT-2.x.git","clone_url":"https://github.com/SIJOT/SIJOT-2.x.git","svn_url":"https://github.com/SIJOT/SIJOT-2.x","homepage":"www.st-joris-turnhout.dev","size":11070,"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":46,"forks":0,"open_issues":46,"watchers":0,"default_branch":"master"}},"base":{"label":"SIJOT:master","ref":"master","sha":"87826c64d553b49c508251a7488f67fd4e3fc584","user":{"login":"SIJOT","id":16041196,"avatar_url":"https://avatars.githubusercontent.com/u/16041196?v=3","gravatar_id":"","url":"https://api.github.com/users/SIJOT","html_url":"https://github.com/SIJOT","followers_url":"https://api.github.com/users/SIJOT/followers","following_url":"https://api.github.com/users/SIJOT/following{/other_user}","gists_url":"https://api.github.com/users/SIJOT/gists{/gist_id}","starred_url":"https://api.github.com/users/SIJOT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SIJOT/subscriptions","organizations_url":"https://api.github.com/users/SIJOT/orgs","repos_url":"https://api.github.com/users/SIJOT/repos","events_url":"https://api.github.com/users/SIJOT/events{/privacy}","received_events_url":"https://api.github.com/users/SIJOT/received_events","type":"Organization","site_admin":false},"repo":{"id":45360682,"name":"SIJOT-2.x","full_name":"SIJOT/SIJOT-2.x","owner":{"login":"SIJOT","id":16041196,"avatar_url":"https://avatars.githubusercontent.com/u/16041196?v=3","gravatar_id":"","url":"https://api.github.com/users/SIJOT","html_url":"https://github.com/SIJOT","followers_url":"https://api.github.com/users/SIJOT/followers","following_url":"https://api.github.com/users/SIJOT/following{/other_user}","gists_url":"https://api.github.com/users/SIJOT/gists{/gist_id}","starred_url":"https://api.github.com/users/SIJOT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SIJOT/subscriptions","organizations_url":"https://api.github.com/users/SIJOT/orgs","repos_url":"https://api.github.com/users/SIJOT/repos","events_url":"https://api.github.com/users/SIJOT/events{/privacy}","received_events_url":"https://api.github.com/users/SIJOT/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SIJOT/SIJOT-2.x","description":"[Under development] SIJOT platform","fork":false,"url":"https://api.github.com/repos/SIJOT/SIJOT-2.x","forks_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/forks","keys_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/teams","hooks_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/hooks","issue_events_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/events{/number}","events_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/events","assignees_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/assignees{/user}","branches_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/branches{/branch}","tags_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/tags","blobs_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/refs{/sha}","trees_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/statuses/{sha}","languages_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/languages","stargazers_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/stargazers","contributors_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/contributors","subscribers_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/subscribers","subscription_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/subscription","commits_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/commits{/sha}","git_commits_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/git/commits{/sha}","comments_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/comments{/number}","issue_comment_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/comments{/number}","contents_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/contents/{+path}","compare_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/merges","archive_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/downloads","issues_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues{/number}","pulls_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls{/number}","milestones_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/milestones{/number}","notifications_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/labels{/name}","releases_url":"https://api.github.com/repos/SIJOT/SIJOT-2.x/releases{/id}","created_at":"2015-11-01T22:43:48Z","updated_at":"2015-12-13T01:28:07Z","pushed_at":"2015-12-30T01:16:13Z","git_url":"git://github.com/SIJOT/SIJOT-2.x.git","ssh_url":"git@github.com:SIJOT/SIJOT-2.x.git","clone_url":"https://github.com/SIJOT/SIJOT-2.x.git","svn_url":"https://github.com/SIJOT/SIJOT-2.x","homepage":"www.st-joris-turnhout.dev","size":11070,"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":46,"forks":0,"open_issues":46,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174"},"html":{"href":"https://github.com/SIJOT/SIJOT-2.x/pull/174"},"issue":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/174"},"comments":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/SIJOT/SIJOT-2.x/statuses/3d391ec7dd1cff605262151c625905f5ace4f891"}}}}