{"action":"created","comment":{"url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/comments/55685058","id":55685058,"diff_hunk":"@@ -0,0 +1,48 @@\n+<?php\n+namespace Clearbooks\\Labs\\Client\\Toggle\\Segment;\n+\n+use Clearbooks\\Labs\\Client\\Toggle\\Entity\\SegmentStub;\n+\n+class SegmentPriorityArrangerTest extends \\PHPUnit_Framework_TestCase\n+{\n+    /**\n+     * @var SegmentPriorityArranger\n+     */\n+    private $segmentPriorityArranger;\n+\n+    public function setUp()\n+    {\n+        parent::setUp();\n+        $this->segmentPriorityArranger = new SegmentPriorityArranger();\n+    }\n+\n+    /**\n+     * @test\n+     */\n+    public function GivenEmptyArray_ExpectEmptyArray()\n+    {\n+        $segments = [ ];\n+        $orderedSegments = $this->segmentPriorityArranger->orderSegmentsByPriority( $segments );\n+        $this->assertEquals( $segments, $orderedSegments );\n+    }\n+\n+    /**\n+     * @test\n+     */\n+    public function GivenUnorderedSegments_ExpectOrderedListByPriority()\n+    {\n+        $segments = [\n+            new SegmentStub( 5, 5 ),\n+            new SegmentStub( 4, 4 ),\n+            new SegmentStub( 3, 3 ),\n+            new SegmentStub( 2, 2 ),\n+            new SegmentStub( 1, 1 )\n+        ];\n+\n+        $shuffledSegments = $segments;","path":"test/Toggle/Segment/SegmentPriorityArrangerTest.php","position":42,"original_position":42,"commit_id":"2053f7c7d5574a38a781324749a49b1f335ddc34","original_commit_id":"2053f7c7d5574a38a781324749a49b1f335ddc34","user":{"login":"peter-horvath","id":3007129,"avatar_url":"https://avatars.githubusercontent.com/u/3007129?v=3","gravatar_id":"","url":"https://api.github.com/users/peter-horvath","html_url":"https://github.com/peter-horvath","followers_url":"https://api.github.com/users/peter-horvath/followers","following_url":"https://api.github.com/users/peter-horvath/following{/other_user}","gists_url":"https://api.github.com/users/peter-horvath/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-horvath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-horvath/subscriptions","organizations_url":"https://api.github.com/users/peter-horvath/orgs","repos_url":"https://api.github.com/users/peter-horvath/repos","events_url":"https://api.github.com/users/peter-horvath/events{/privacy}","received_events_url":"https://api.github.com/users/peter-horvath/received_events","type":"User","site_admin":false},"body":"No, the next line does :D This just copies the array. Assigning variables by reference has to be explicit in PHP, it copies by default.","created_at":"2016-03-10T14:21:41Z","updated_at":"2016-03-10T14:21:41Z","html_url":"https://github.com/clearbooks/labs-php-client/pull/12#discussion_r55685058","pull_request_url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/comments/55685058"},"html":{"href":"https://github.com/clearbooks/labs-php-client/pull/12#discussion_r55685058"},"pull_request":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12","id":62259240,"html_url":"https://github.com/clearbooks/labs-php-client/pull/12","diff_url":"https://github.com/clearbooks/labs-php-client/pull/12.diff","patch_url":"https://github.com/clearbooks/labs-php-client/pull/12.patch","issue_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues/12","number":12,"state":"open","locked":false,"title":"CanDefaultToggleStatusBeOverruled use case (DEV-7306)","user":{"login":"peter-horvath","id":3007129,"avatar_url":"https://avatars.githubusercontent.com/u/3007129?v=3","gravatar_id":"","url":"https://api.github.com/users/peter-horvath","html_url":"https://github.com/peter-horvath","followers_url":"https://api.github.com/users/peter-horvath/followers","following_url":"https://api.github.com/users/peter-horvath/following{/other_user}","gists_url":"https://api.github.com/users/peter-horvath/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-horvath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-horvath/subscriptions","organizations_url":"https://api.github.com/users/peter-horvath/orgs","repos_url":"https://api.github.com/users/peter-horvath/repos","events_url":"https://api.github.com/users/peter-horvath/events{/privacy}","received_events_url":"https://api.github.com/users/peter-horvath/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-09T16:51:23Z","updated_at":"2016-03-10T14:21:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8ef19c9c9d6a68fc0ef144efa95d5e0120cdb24","assignee":{"login":"luos","id":923194,"avatar_url":"https://avatars.githubusercontent.com/u/923194?v=3","gravatar_id":"","url":"https://api.github.com/users/luos","html_url":"https://github.com/luos","followers_url":"https://api.github.com/users/luos/followers","following_url":"https://api.github.com/users/luos/following{/other_user}","gists_url":"https://api.github.com/users/luos/gists{/gist_id}","starred_url":"https://api.github.com/users/luos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luos/subscriptions","organizations_url":"https://api.github.com/users/luos/orgs","repos_url":"https://api.github.com/users/luos/repos","events_url":"https://api.github.com/users/luos/events{/privacy}","received_events_url":"https://api.github.com/users/luos/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12/commits","review_comments_url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12/comments","review_comment_url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues/12/comments","statuses_url":"https://api.github.com/repos/clearbooks/labs-php-client/statuses/2053f7c7d5574a38a781324749a49b1f335ddc34","head":{"label":"clearbooks:DEV-7306-can-default-toggle-status-be-overruled","ref":"DEV-7306-can-default-toggle-status-be-overruled","sha":"2053f7c7d5574a38a781324749a49b1f335ddc34","user":{"login":"clearbooks","id":976249,"avatar_url":"https://avatars.githubusercontent.com/u/976249?v=3","gravatar_id":"","url":"https://api.github.com/users/clearbooks","html_url":"https://github.com/clearbooks","followers_url":"https://api.github.com/users/clearbooks/followers","following_url":"https://api.github.com/users/clearbooks/following{/other_user}","gists_url":"https://api.github.com/users/clearbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/clearbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearbooks/subscriptions","organizations_url":"https://api.github.com/users/clearbooks/orgs","repos_url":"https://api.github.com/users/clearbooks/repos","events_url":"https://api.github.com/users/clearbooks/events{/privacy}","received_events_url":"https://api.github.com/users/clearbooks/received_events","type":"Organization","site_admin":false},"repo":{"id":39496233,"name":"labs-php-client","full_name":"clearbooks/labs-php-client","owner":{"login":"clearbooks","id":976249,"avatar_url":"https://avatars.githubusercontent.com/u/976249?v=3","gravatar_id":"","url":"https://api.github.com/users/clearbooks","html_url":"https://github.com/clearbooks","followers_url":"https://api.github.com/users/clearbooks/followers","following_url":"https://api.github.com/users/clearbooks/following{/other_user}","gists_url":"https://api.github.com/users/clearbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/clearbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearbooks/subscriptions","organizations_url":"https://api.github.com/users/clearbooks/orgs","repos_url":"https://api.github.com/users/clearbooks/repos","events_url":"https://api.github.com/users/clearbooks/events{/privacy}","received_events_url":"https://api.github.com/users/clearbooks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clearbooks/labs-php-client","description":"Client for PHP applications","fork":false,"url":"https://api.github.com/repos/clearbooks/labs-php-client","forks_url":"https://api.github.com/repos/clearbooks/labs-php-client/forks","keys_url":"https://api.github.com/repos/clearbooks/labs-php-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clearbooks/labs-php-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clearbooks/labs-php-client/teams","hooks_url":"https://api.github.com/repos/clearbooks/labs-php-client/hooks","issue_events_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues/events{/number}","events_url":"https://api.github.com/repos/clearbooks/labs-php-client/events","assignees_url":"https://api.github.com/repos/clearbooks/labs-php-client/assignees{/user}","branches_url":"https://api.github.com/repos/clearbooks/labs-php-client/branches{/branch}","tags_url":"https://api.github.com/repos/clearbooks/labs-php-client/tags","blobs_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clearbooks/labs-php-client/statuses/{sha}","languages_url":"https://api.github.com/repos/clearbooks/labs-php-client/languages","stargazers_url":"https://api.github.com/repos/clearbooks/labs-php-client/stargazers","contributors_url":"https://api.github.com/repos/clearbooks/labs-php-client/contributors","subscribers_url":"https://api.github.com/repos/clearbooks/labs-php-client/subscribers","subscription_url":"https://api.github.com/repos/clearbooks/labs-php-client/subscription","commits_url":"https://api.github.com/repos/clearbooks/labs-php-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/clearbooks/labs-php-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/clearbooks/labs-php-client/contents/{+path}","compare_url":"https://api.github.com/repos/clearbooks/labs-php-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clearbooks/labs-php-client/merges","archive_url":"https://api.github.com/repos/clearbooks/labs-php-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clearbooks/labs-php-client/downloads","issues_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues{/number}","pulls_url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls{/number}","milestones_url":"https://api.github.com/repos/clearbooks/labs-php-client/milestones{/number}","notifications_url":"https://api.github.com/repos/clearbooks/labs-php-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clearbooks/labs-php-client/labels{/name}","releases_url":"https://api.github.com/repos/clearbooks/labs-php-client/releases{/id}","deployments_url":"https://api.github.com/repos/clearbooks/labs-php-client/deployments","created_at":"2015-07-22T09:00:35Z","updated_at":"2016-02-10T11:13:15Z","pushed_at":"2016-03-10T14:14:46Z","git_url":"git://github.com/clearbooks/labs-php-client.git","ssh_url":"git@github.com:clearbooks/labs-php-client.git","clone_url":"https://github.com/clearbooks/labs-php-client.git","svn_url":"https://github.com/clearbooks/labs-php-client","homepage":null,"size":281,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"clearbooks:master","ref":"master","sha":"5d66920266f74eba51237de28a0293c490bc5c94","user":{"login":"clearbooks","id":976249,"avatar_url":"https://avatars.githubusercontent.com/u/976249?v=3","gravatar_id":"","url":"https://api.github.com/users/clearbooks","html_url":"https://github.com/clearbooks","followers_url":"https://api.github.com/users/clearbooks/followers","following_url":"https://api.github.com/users/clearbooks/following{/other_user}","gists_url":"https://api.github.com/users/clearbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/clearbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearbooks/subscriptions","organizations_url":"https://api.github.com/users/clearbooks/orgs","repos_url":"https://api.github.com/users/clearbooks/repos","events_url":"https://api.github.com/users/clearbooks/events{/privacy}","received_events_url":"https://api.github.com/users/clearbooks/received_events","type":"Organization","site_admin":false},"repo":{"id":39496233,"name":"labs-php-client","full_name":"clearbooks/labs-php-client","owner":{"login":"clearbooks","id":976249,"avatar_url":"https://avatars.githubusercontent.com/u/976249?v=3","gravatar_id":"","url":"https://api.github.com/users/clearbooks","html_url":"https://github.com/clearbooks","followers_url":"https://api.github.com/users/clearbooks/followers","following_url":"https://api.github.com/users/clearbooks/following{/other_user}","gists_url":"https://api.github.com/users/clearbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/clearbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearbooks/subscriptions","organizations_url":"https://api.github.com/users/clearbooks/orgs","repos_url":"https://api.github.com/users/clearbooks/repos","events_url":"https://api.github.com/users/clearbooks/events{/privacy}","received_events_url":"https://api.github.com/users/clearbooks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clearbooks/labs-php-client","description":"Client for PHP applications","fork":false,"url":"https://api.github.com/repos/clearbooks/labs-php-client","forks_url":"https://api.github.com/repos/clearbooks/labs-php-client/forks","keys_url":"https://api.github.com/repos/clearbooks/labs-php-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clearbooks/labs-php-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clearbooks/labs-php-client/teams","hooks_url":"https://api.github.com/repos/clearbooks/labs-php-client/hooks","issue_events_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues/events{/number}","events_url":"https://api.github.com/repos/clearbooks/labs-php-client/events","assignees_url":"https://api.github.com/repos/clearbooks/labs-php-client/assignees{/user}","branches_url":"https://api.github.com/repos/clearbooks/labs-php-client/branches{/branch}","tags_url":"https://api.github.com/repos/clearbooks/labs-php-client/tags","blobs_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clearbooks/labs-php-client/statuses/{sha}","languages_url":"https://api.github.com/repos/clearbooks/labs-php-client/languages","stargazers_url":"https://api.github.com/repos/clearbooks/labs-php-client/stargazers","contributors_url":"https://api.github.com/repos/clearbooks/labs-php-client/contributors","subscribers_url":"https://api.github.com/repos/clearbooks/labs-php-client/subscribers","subscription_url":"https://api.github.com/repos/clearbooks/labs-php-client/subscription","commits_url":"https://api.github.com/repos/clearbooks/labs-php-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/clearbooks/labs-php-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/clearbooks/labs-php-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/clearbooks/labs-php-client/contents/{+path}","compare_url":"https://api.github.com/repos/clearbooks/labs-php-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clearbooks/labs-php-client/merges","archive_url":"https://api.github.com/repos/clearbooks/labs-php-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clearbooks/labs-php-client/downloads","issues_url":"https://api.github.com/repos/clearbooks/labs-php-client/issues{/number}","pulls_url":"https://api.github.com/repos/clearbooks/labs-php-client/pulls{/number}","milestones_url":"https://api.github.com/repos/clearbooks/labs-php-client/milestones{/number}","notifications_url":"https://api.github.com/repos/clearbooks/labs-php-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clearbooks/labs-php-client/labels{/name}","releases_url":"https://api.github.com/repos/clearbooks/labs-php-client/releases{/id}","deployments_url":"https://api.github.com/repos/clearbooks/labs-php-client/deployments","created_at":"2015-07-22T09:00:35Z","updated_at":"2016-02-10T11:13:15Z","pushed_at":"2016-03-10T14:14:46Z","git_url":"git://github.com/clearbooks/labs-php-client.git","ssh_url":"git@github.com:clearbooks/labs-php-client.git","clone_url":"https://github.com/clearbooks/labs-php-client.git","svn_url":"https://github.com/clearbooks/labs-php-client","homepage":null,"size":281,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12"},"html":{"href":"https://github.com/clearbooks/labs-php-client/pull/12"},"issue":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/issues/12"},"comments":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/clearbooks/labs-php-client/statuses/2053f7c7d5574a38a781324749a49b1f335ddc34"}}}}