{"action":"created","comment":{"url":"https://api.github.com/repos/neontribe/ARCVService/pulls/comments/230003616","pull_request_review_id":170632586,"id":230003616,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDAwMzYxNg==","diff_hunk":"@@ -239,4 +310,41 @@ public function testICanDeleteANamedVoucher()\n         // Assert voucher is back to dispatched\n         $this->assertEquals('dispatched', $voucher->currentstate);\n     }\n+\n+    /** @test */\n+    public function testICanSyncAnArrayOfVouchers()\n+    {\n+        $put_route = route('store.registration.vouchers.put', ['registration' => $this->registration->id]);\n+\n+        // sync a voucher;\n+        $this->actingAs($this->centreUser, 'store')\n+            ->put($put_route, ['vouchers' => [$this->testCodes[0]]]);\n+\n+        $currentBundle = $this->registration->currentBundle();\n+        $this->assertEquals(1, $currentBundle->vouchers()->count());\n+\n+        // re-sync with 3 vouchers\n+        $this->actingAs($this->centreUser, 'store')\n+            ->put($put_route, ['vouchers' => $this->testCodes]);\n+\n+        $currentBundle->refresh();\n+        $this->assertEquals(count($this->testCodes), $currentBundle->vouchers()->count());\n+\n+        // sync without a voucher array AT ALL - does nothing.\n+        $this->actingAs($this->centreUser, 'store')\n+            ->put($put_route, []);\n+\n+        $currentBundle->refresh();\n+        $this->assertEquals(count($this->testCodes), $currentBundle->vouchers()->count());\n+\n+        // sync with only a single empty voucher string erases the vouchers.\n+        $this->assertEquals(3, $currentBundle->vouchers()->count());\n+\n+        $this->actingAs($this->centreUser, 'store')\n+            ->put($put_route, ['vouchers' => [''] ]);\n+\n+        $currentBundle->refresh();\n+        //dd($currentBundle->vouchers->toArray());","path":"tests/Unit/Controllers/Store/BundleControllerTest.php","position":116,"original_position":116,"commit_id":"d72a6f782094a6aee854e2d60f2edfde5ba74996","original_commit_id":"d72a6f782094a6aee854e2d60f2edfde5ba74996","user":{"login":"katjam","id":861172,"node_id":"MDQ6VXNlcjg2MTE3Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/861172?v=4","gravatar_id":"","url":"https://api.github.com/users/katjam","html_url":"https://github.com/katjam","followers_url":"https://api.github.com/users/katjam/followers","following_url":"https://api.github.com/users/katjam/following{/other_user}","gists_url":"https://api.github.com/users/katjam/gists{/gist_id}","starred_url":"https://api.github.com/users/katjam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katjam/subscriptions","organizations_url":"https://api.github.com/users/katjam/orgs","repos_url":"https://api.github.com/users/katjam/repos","events_url":"https://api.github.com/users/katjam/events{/privacy}","received_events_url":"https://api.github.com/users/katjam/received_events","type":"User","site_admin":false},"body":"remove `dd()`","created_at":"2018-11-01T10:50:48Z","updated_at":"2018-11-01T10:52:53Z","html_url":"https://github.com/neontribe/ARCVService/pull/195#discussion_r230003616","pull_request_url":"https://api.github.com/repos/neontribe/ARCVService/pulls/195","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/neontribe/ARCVService/pulls/comments/230003616"},"html":{"href":"https://github.com/neontribe/ARCVService/pull/195#discussion_r230003616"},"pull_request":{"href":"https://api.github.com/repos/neontribe/ARCVService/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/neontribe/ARCVService/pulls/195","id":227337838,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3MzM3ODM4","html_url":"https://github.com/neontribe/ARCVService/pull/195","diff_url":"https://github.com/neontribe/ARCVService/pull/195.diff","patch_url":"https://github.com/neontribe/ARCVService/pull/195.patch","issue_url":"https://api.github.com/repos/neontribe/ARCVService/issues/195","number":195,"state":"open","locked":false,"title":"1.4/1125 write back end submission process catch and validate","user":{"login":"charlesstrange2","id":25037036,"node_id":"MDQ6VXNlcjI1MDM3MDM2","avatar_url":"https://avatars3.githubusercontent.com/u/25037036?v=4","gravatar_id":"","url":"https://api.github.com/users/charlesstrange2","html_url":"https://github.com/charlesstrange2","followers_url":"https://api.github.com/users/charlesstrange2/followers","following_url":"https://api.github.com/users/charlesstrange2/following{/other_user}","gists_url":"https://api.github.com/users/charlesstrange2/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesstrange2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesstrange2/subscriptions","organizations_url":"https://api.github.com/users/charlesstrange2/orgs","repos_url":"https://api.github.com/users/charlesstrange2/repos","events_url":"https://api.github.com/users/charlesstrange2/events{/privacy}","received_events_url":"https://api.github.com/users/charlesstrange2/received_events","type":"User","site_admin":false},"body":"https://trello.com/c/4ytgNNUB/1125-write-back-end-submission-process-catch-and-validate","created_at":"2018-10-31T15:42:21Z","updated_at":"2018-11-01T10:52:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cf0567619fe0a04a06ed5a07efe3a65d1924827","assignee":null,"assignees":[],"requested_reviewers":[{"login":"alexalala","id":11891294,"node_id":"MDQ6VXNlcjExODkxMjk0","avatar_url":"https://avatars3.githubusercontent.com/u/11891294?v=4","gravatar_id":"","url":"https://api.github.com/users/alexalala","html_url":"https://github.com/alexalala","followers_url":"https://api.github.com/users/alexalala/followers","following_url":"https://api.github.com/users/alexalala/following{/other_user}","gists_url":"https://api.github.com/users/alexalala/gists{/gist_id}","starred_url":"https://api.github.com/users/alexalala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexalala/subscriptions","organizations_url":"https://api.github.com/users/alexalala/orgs","repos_url":"https://api.github.com/users/alexalala/repos","events_url":"https://api.github.com/users/alexalala/events{/privacy}","received_events_url":"https://api.github.com/users/alexalala/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/neontribe/ARCVService/pulls/195/commits","review_comments_url":"https://api.github.com/repos/neontribe/ARCVService/pulls/195/comments","review_comment_url":"https://api.github.com/repos/neontribe/ARCVService/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neontribe/ARCVService/issues/195/comments","statuses_url":"https://api.github.com/repos/neontribe/ARCVService/statuses/d72a6f782094a6aee854e2d60f2edfde5ba74996","head":{"label":"neontribe:1.4/1125-write-back-end-submission-process-catch-and-validate","ref":"1.4/1125-write-back-end-submission-process-catch-and-validate","sha":"d72a6f782094a6aee854e2d60f2edfde5ba74996","user":{"login":"neontribe","id":814085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDA4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/814085?v=4","gravatar_id":"","url":"https://api.github.com/users/neontribe","html_url":"https://github.com/neontribe","followers_url":"https://api.github.com/users/neontribe/followers","following_url":"https://api.github.com/users/neontribe/following{/other_user}","gists_url":"https://api.github.com/users/neontribe/gists{/gist_id}","starred_url":"https://api.github.com/users/neontribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neontribe/subscriptions","organizations_url":"https://api.github.com/users/neontribe/orgs","repos_url":"https://api.github.com/users/neontribe/repos","events_url":"https://api.github.com/users/neontribe/events{/privacy}","received_events_url":"https://api.github.com/users/neontribe/received_events","type":"Organization","site_admin":false},"repo":{"id":88754893,"node_id":"MDEwOlJlcG9zaXRvcnk4ODc1NDg5Mw==","name":"ARCVService","full_name":"neontribe/ARCVService","private":false,"owner":{"login":"neontribe","id":814085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDA4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/814085?v=4","gravatar_id":"","url":"https://api.github.com/users/neontribe","html_url":"https://github.com/neontribe","followers_url":"https://api.github.com/users/neontribe/followers","following_url":"https://api.github.com/users/neontribe/following{/other_user}","gists_url":"https://api.github.com/users/neontribe/gists{/gist_id}","starred_url":"https://api.github.com/users/neontribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neontribe/subscriptions","organizations_url":"https://api.github.com/users/neontribe/orgs","repos_url":"https://api.github.com/users/neontribe/repos","events_url":"https://api.github.com/users/neontribe/events{/privacy}","received_events_url":"https://api.github.com/users/neontribe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/neontribe/ARCVService","description":"ARC Voucher Service/API","fork":false,"url":"https://api.github.com/repos/neontribe/ARCVService","forks_url":"https://api.github.com/repos/neontribe/ARCVService/forks","keys_url":"https://api.github.com/repos/neontribe/ARCVService/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neontribe/ARCVService/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neontribe/ARCVService/teams","hooks_url":"https://api.github.com/repos/neontribe/ARCVService/hooks","issue_events_url":"https://api.github.com/repos/neontribe/ARCVService/issues/events{/number}","events_url":"https://api.github.com/repos/neontribe/ARCVService/events","assignees_url":"https://api.github.com/repos/neontribe/ARCVService/assignees{/user}","branches_url":"https://api.github.com/repos/neontribe/ARCVService/branches{/branch}","tags_url":"https://api.github.com/repos/neontribe/ARCVService/tags","blobs_url":"https://api.github.com/repos/neontribe/ARCVService/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neontribe/ARCVService/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neontribe/ARCVService/git/refs{/sha}","trees_url":"https://api.github.com/repos/neontribe/ARCVService/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neontribe/ARCVService/statuses/{sha}","languages_url":"https://api.github.com/repos/neontribe/ARCVService/languages","stargazers_url":"https://api.github.com/repos/neontribe/ARCVService/stargazers","contributors_url":"https://api.github.com/repos/neontribe/ARCVService/contributors","subscribers_url":"https://api.github.com/repos/neontribe/ARCVService/subscribers","subscription_url":"https://api.github.com/repos/neontribe/ARCVService/subscription","commits_url":"https://api.github.com/repos/neontribe/ARCVService/commits{/sha}","git_commits_url":"https://api.github.com/repos/neontribe/ARCVService/git/commits{/sha}","comments_url":"https://api.github.com/repos/neontribe/ARCVService/comments{/number}","issue_comment_url":"https://api.github.com/repos/neontribe/ARCVService/issues/comments{/number}","contents_url":"https://api.github.com/repos/neontribe/ARCVService/contents/{+path}","compare_url":"https://api.github.com/repos/neontribe/ARCVService/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neontribe/ARCVService/merges","archive_url":"https://api.github.com/repos/neontribe/ARCVService/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neontribe/ARCVService/downloads","issues_url":"https://api.github.com/repos/neontribe/ARCVService/issues{/number}","pulls_url":"https://api.github.com/repos/neontribe/ARCVService/pulls{/number}","milestones_url":"https://api.github.com/repos/neontribe/ARCVService/milestones{/number}","notifications_url":"https://api.github.com/repos/neontribe/ARCVService/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neontribe/ARCVService/labels{/name}","releases_url":"https://api.github.com/repos/neontribe/ARCVService/releases{/id}","deployments_url":"https://api.github.com/repos/neontribe/ARCVService/deployments","created_at":"2017-04-19T14:31:12Z","updated_at":"2018-10-31T11:27:13Z","pushed_at":"2018-10-31T16:40:15Z","git_url":"git://github.com/neontribe/ARCVService.git","ssh_url":"git@github.com:neontribe/ARCVService.git","clone_url":"https://github.com/neontribe/ARCVService.git","svn_url":"https://github.com/neontribe/ARCVService","homepage":null,"size":3319,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"1.4/release"}},"base":{"label":"neontribe:1.4/release","ref":"1.4/release","sha":"682e2e7591ad755f6790ef03872abd78653044c3","user":{"login":"neontribe","id":814085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDA4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/814085?v=4","gravatar_id":"","url":"https://api.github.com/users/neontribe","html_url":"https://github.com/neontribe","followers_url":"https://api.github.com/users/neontribe/followers","following_url":"https://api.github.com/users/neontribe/following{/other_user}","gists_url":"https://api.github.com/users/neontribe/gists{/gist_id}","starred_url":"https://api.github.com/users/neontribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neontribe/subscriptions","organizations_url":"https://api.github.com/users/neontribe/orgs","repos_url":"https://api.github.com/users/neontribe/repos","events_url":"https://api.github.com/users/neontribe/events{/privacy}","received_events_url":"https://api.github.com/users/neontribe/received_events","type":"Organization","site_admin":false},"repo":{"id":88754893,"node_id":"MDEwOlJlcG9zaXRvcnk4ODc1NDg5Mw==","name":"ARCVService","full_name":"neontribe/ARCVService","private":false,"owner":{"login":"neontribe","id":814085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDA4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/814085?v=4","gravatar_id":"","url":"https://api.github.com/users/neontribe","html_url":"https://github.com/neontribe","followers_url":"https://api.github.com/users/neontribe/followers","following_url":"https://api.github.com/users/neontribe/following{/other_user}","gists_url":"https://api.github.com/users/neontribe/gists{/gist_id}","starred_url":"https://api.github.com/users/neontribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neontribe/subscriptions","organizations_url":"https://api.github.com/users/neontribe/orgs","repos_url":"https://api.github.com/users/neontribe/repos","events_url":"https://api.github.com/users/neontribe/events{/privacy}","received_events_url":"https://api.github.com/users/neontribe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/neontribe/ARCVService","description":"ARC Voucher Service/API","fork":false,"url":"https://api.github.com/repos/neontribe/ARCVService","forks_url":"https://api.github.com/repos/neontribe/ARCVService/forks","keys_url":"https://api.github.com/repos/neontribe/ARCVService/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neontribe/ARCVService/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neontribe/ARCVService/teams","hooks_url":"https://api.github.com/repos/neontribe/ARCVService/hooks","issue_events_url":"https://api.github.com/repos/neontribe/ARCVService/issues/events{/number}","events_url":"https://api.github.com/repos/neontribe/ARCVService/events","assignees_url":"https://api.github.com/repos/neontribe/ARCVService/assignees{/user}","branches_url":"https://api.github.com/repos/neontribe/ARCVService/branches{/branch}","tags_url":"https://api.github.com/repos/neontribe/ARCVService/tags","blobs_url":"https://api.github.com/repos/neontribe/ARCVService/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neontribe/ARCVService/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neontribe/ARCVService/git/refs{/sha}","trees_url":"https://api.github.com/repos/neontribe/ARCVService/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neontribe/ARCVService/statuses/{sha}","languages_url":"https://api.github.com/repos/neontribe/ARCVService/languages","stargazers_url":"https://api.github.com/repos/neontribe/ARCVService/stargazers","contributors_url":"https://api.github.com/repos/neontribe/ARCVService/contributors","subscribers_url":"https://api.github.com/repos/neontribe/ARCVService/subscribers","subscription_url":"https://api.github.com/repos/neontribe/ARCVService/subscription","commits_url":"https://api.github.com/repos/neontribe/ARCVService/commits{/sha}","git_commits_url":"https://api.github.com/repos/neontribe/ARCVService/git/commits{/sha}","comments_url":"https://api.github.com/repos/neontribe/ARCVService/comments{/number}","issue_comment_url":"https://api.github.com/repos/neontribe/ARCVService/issues/comments{/number}","contents_url":"https://api.github.com/repos/neontribe/ARCVService/contents/{+path}","compare_url":"https://api.github.com/repos/neontribe/ARCVService/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neontribe/ARCVService/merges","archive_url":"https://api.github.com/repos/neontribe/ARCVService/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neontribe/ARCVService/downloads","issues_url":"https://api.github.com/repos/neontribe/ARCVService/issues{/number}","pulls_url":"https://api.github.com/repos/neontribe/ARCVService/pulls{/number}","milestones_url":"https://api.github.com/repos/neontribe/ARCVService/milestones{/number}","notifications_url":"https://api.github.com/repos/neontribe/ARCVService/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neontribe/ARCVService/labels{/name}","releases_url":"https://api.github.com/repos/neontribe/ARCVService/releases{/id}","deployments_url":"https://api.github.com/repos/neontribe/ARCVService/deployments","created_at":"2017-04-19T14:31:12Z","updated_at":"2018-10-31T11:27:13Z","pushed_at":"2018-10-31T16:40:15Z","git_url":"git://github.com/neontribe/ARCVService.git","ssh_url":"git@github.com:neontribe/ARCVService.git","clone_url":"https://github.com/neontribe/ARCVService.git","svn_url":"https://github.com/neontribe/ARCVService","homepage":null,"size":3319,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"1.4/release"}},"_links":{"self":{"href":"https://api.github.com/repos/neontribe/ARCVService/pulls/195"},"html":{"href":"https://github.com/neontribe/ARCVService/pull/195"},"issue":{"href":"https://api.github.com/repos/neontribe/ARCVService/issues/195"},"comments":{"href":"https://api.github.com/repos/neontribe/ARCVService/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/neontribe/ARCVService/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/neontribe/ARCVService/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neontribe/ARCVService/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/neontribe/ARCVService/statuses/d72a6f782094a6aee854e2d60f2edfde5ba74996"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"katjam"}}