{"action":"created","comment":{"url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments/55338622","id":55338622,"diff_hunk":"@@ -170,20 +171,13 @@ public function testGivenInvalidLanguageCode_removeByLanguageThrowsException( $l\n \t}\n \n \tpublic function testGivenEmptyGroups_constructorRemovesThem() {\n-\t\t$enGroup = new AliasGroup( 'en', array( 'foo' ) );\n-\n \t\t$list = new AliasGroupList( array(\n \t\t\tnew AliasGroup( 'de' ),\n-\t\t\t$enGroup,\n-\t\t\tnew AliasGroup( 'en' ),\n-\t\t\tnew AliasGroup( 'nl' ),\n-\t\t) );\n-\n-\t\t$expectedList = new AliasGroupList( array(\n+\t\t\tnew AliasGroup( 'en', array( 'foo' ) ),\n \t\t\tnew AliasGroup( 'en' ),\n \t\t) );\n \n-\t\t$this->assertEquals( $expectedList, $list );\n+\t\t$this->assertEquals( new AliasGroupList(), $list );","path":"tests/unit/Term/AliasGroupListTest.php","position":54,"original_position":54,"commit_id":"626f094d10704c9185510b6ef455896bbdf00018","original_commit_id":"626f094d10704c9185510b6ef455896bbdf00018","user":{"login":"thiemowmde","id":6576639,"avatar_url":"https://avatars.githubusercontent.com/u/6576639?v=3","gravatar_id":"","url":"https://api.github.com/users/thiemowmde","html_url":"https://github.com/thiemowmde","followers_url":"https://api.github.com/users/thiemowmde/followers","following_url":"https://api.github.com/users/thiemowmde/following{/other_user}","gists_url":"https://api.github.com/users/thiemowmde/gists{/gist_id}","starred_url":"https://api.github.com/users/thiemowmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiemowmde/subscriptions","organizations_url":"https://api.github.com/users/thiemowmde/orgs","repos_url":"https://api.github.com/users/thiemowmde/repos","events_url":"https://api.github.com/users/thiemowmde/events{/privacy}","received_events_url":"https://api.github.com/users/thiemowmde/received_events","type":"User","site_admin":false},"body":"This test is the whole reason why I touched this code. Multiple issues:\r\n\r\n1. `$expectedList` was empty, because it was constructed with an empty group. This means the assertion compared an empty list with an empty list. This patch does not change that.\r\n2. Sure, we could add a non-empty group to both constructors. Again, multiple issues with that:\r\n 1. There are many other tests that already check if the constructor accepts non-empty groups. We do not need to repeat this assertion again, in a test that's about something else.\r\n 2. The assertion would compare code with itself. If one constructors stops accepting non-empty groups, the other would do the same and the assertion would succeed. Which is, by the way, an other reason why I believe comparing objects with `assertEquals` is bogus. A test that compares the results of two constructors (or two identical method calls) with `assertEquals` is not worth much because of this issue. An assertion using `isEmpty` or `count` would be much more reliable in this specific example.","created_at":"2016-03-08T10:06:14Z","updated_at":"2016-03-08T10:06:14Z","html_url":"https://github.com/wmde/WikibaseDataModel/pull/645#discussion_r55338622","pull_request_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645","_links":{"self":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments/55338622"},"html":{"href":"https://github.com/wmde/WikibaseDataModel/pull/645#discussion_r55338622"},"pull_request":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645"}}},"pull_request":{"url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645","id":60649028,"html_url":"https://github.com/wmde/WikibaseDataModel/pull/645","diff_url":"https://github.com/wmde/WikibaseDataModel/pull/645.diff","patch_url":"https://github.com/wmde/WikibaseDataModel/pull/645.patch","issue_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/645","number":645,"state":"open","locked":false,"title":"Simplify and clean up AliasGroupListTest assertions","user":{"login":"thiemowmde","id":6576639,"avatar_url":"https://avatars.githubusercontent.com/u/6576639?v=3","gravatar_id":"","url":"https://api.github.com/users/thiemowmde","html_url":"https://github.com/thiemowmde","followers_url":"https://api.github.com/users/thiemowmde/followers","following_url":"https://api.github.com/users/thiemowmde/following{/other_user}","gists_url":"https://api.github.com/users/thiemowmde/gists{/gist_id}","starred_url":"https://api.github.com/users/thiemowmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiemowmde/subscriptions","organizations_url":"https://api.github.com/users/thiemowmde/orgs","repos_url":"https://api.github.com/users/thiemowmde/repos","events_url":"https://api.github.com/users/thiemowmde/events{/privacy}","received_events_url":"https://api.github.com/users/thiemowmde/received_events","type":"User","site_admin":false},"body":"* Use more strict `assertSame` whenever possible.\r\n* ~~Use isEmpty when possible, instead of comparing objects.~~\r\n* In `testGivenEmptyGroups_constructorRemovesThem` two objects were compared, but it was never checked if they are empty.","created_at":"2016-02-25T09:33:53Z","updated_at":"2016-03-08T10:06:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bb8b45961a8813cf7775718cc7434be9af4abe9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645/commits","review_comments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645/comments","review_comment_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/645/comments","statuses_url":"https://api.github.com/repos/wmde/WikibaseDataModel/statuses/626f094d10704c9185510b6ef455896bbdf00018","head":{"label":"wmde:aliasGroupTest","ref":"aliasGroupTest","sha":"626f094d10704c9185510b6ef455896bbdf00018","user":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"repo":{"id":15110788,"name":"WikibaseDataModel","full_name":"wmde/WikibaseDataModel","owner":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wmde/WikibaseDataModel","description":"PHP implementation of the Wikibase Data Model","fork":false,"url":"https://api.github.com/repos/wmde/WikibaseDataModel","forks_url":"https://api.github.com/repos/wmde/WikibaseDataModel/forks","keys_url":"https://api.github.com/repos/wmde/WikibaseDataModel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wmde/WikibaseDataModel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wmde/WikibaseDataModel/teams","hooks_url":"https://api.github.com/repos/wmde/WikibaseDataModel/hooks","issue_events_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/events{/number}","events_url":"https://api.github.com/repos/wmde/WikibaseDataModel/events","assignees_url":"https://api.github.com/repos/wmde/WikibaseDataModel/assignees{/user}","branches_url":"https://api.github.com/repos/wmde/WikibaseDataModel/branches{/branch}","tags_url":"https://api.github.com/repos/wmde/WikibaseDataModel/tags","blobs_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/refs{/sha}","trees_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wmde/WikibaseDataModel/statuses/{sha}","languages_url":"https://api.github.com/repos/wmde/WikibaseDataModel/languages","stargazers_url":"https://api.github.com/repos/wmde/WikibaseDataModel/stargazers","contributors_url":"https://api.github.com/repos/wmde/WikibaseDataModel/contributors","subscribers_url":"https://api.github.com/repos/wmde/WikibaseDataModel/subscribers","subscription_url":"https://api.github.com/repos/wmde/WikibaseDataModel/subscription","commits_url":"https://api.github.com/repos/wmde/WikibaseDataModel/commits{/sha}","git_commits_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/commits{/sha}","comments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/comments{/number}","issue_comment_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/comments{/number}","contents_url":"https://api.github.com/repos/wmde/WikibaseDataModel/contents/{+path}","compare_url":"https://api.github.com/repos/wmde/WikibaseDataModel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wmde/WikibaseDataModel/merges","archive_url":"https://api.github.com/repos/wmde/WikibaseDataModel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wmde/WikibaseDataModel/downloads","issues_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues{/number}","pulls_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls{/number}","milestones_url":"https://api.github.com/repos/wmde/WikibaseDataModel/milestones{/number}","notifications_url":"https://api.github.com/repos/wmde/WikibaseDataModel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wmde/WikibaseDataModel/labels{/name}","releases_url":"https://api.github.com/repos/wmde/WikibaseDataModel/releases{/id}","deployments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/deployments","created_at":"2013-12-11T15:20:51Z","updated_at":"2016-01-11T10:39:20Z","pushed_at":"2016-03-08T10:05:37Z","git_url":"git://github.com/wmde/WikibaseDataModel.git","ssh_url":"git@github.com:wmde/WikibaseDataModel.git","clone_url":"https://github.com/wmde/WikibaseDataModel.git","svn_url":"https://github.com/wmde/WikibaseDataModel","homepage":"http://wikiba.se/","size":2118,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":30,"forks":6,"open_issues":30,"watchers":10,"default_branch":"master"}},"base":{"label":"wmde:master","ref":"master","sha":"605a1daba244733cf408d40813bc29570e882971","user":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"repo":{"id":15110788,"name":"WikibaseDataModel","full_name":"wmde/WikibaseDataModel","owner":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wmde/WikibaseDataModel","description":"PHP implementation of the Wikibase Data Model","fork":false,"url":"https://api.github.com/repos/wmde/WikibaseDataModel","forks_url":"https://api.github.com/repos/wmde/WikibaseDataModel/forks","keys_url":"https://api.github.com/repos/wmde/WikibaseDataModel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wmde/WikibaseDataModel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wmde/WikibaseDataModel/teams","hooks_url":"https://api.github.com/repos/wmde/WikibaseDataModel/hooks","issue_events_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/events{/number}","events_url":"https://api.github.com/repos/wmde/WikibaseDataModel/events","assignees_url":"https://api.github.com/repos/wmde/WikibaseDataModel/assignees{/user}","branches_url":"https://api.github.com/repos/wmde/WikibaseDataModel/branches{/branch}","tags_url":"https://api.github.com/repos/wmde/WikibaseDataModel/tags","blobs_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/refs{/sha}","trees_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wmde/WikibaseDataModel/statuses/{sha}","languages_url":"https://api.github.com/repos/wmde/WikibaseDataModel/languages","stargazers_url":"https://api.github.com/repos/wmde/WikibaseDataModel/stargazers","contributors_url":"https://api.github.com/repos/wmde/WikibaseDataModel/contributors","subscribers_url":"https://api.github.com/repos/wmde/WikibaseDataModel/subscribers","subscription_url":"https://api.github.com/repos/wmde/WikibaseDataModel/subscription","commits_url":"https://api.github.com/repos/wmde/WikibaseDataModel/commits{/sha}","git_commits_url":"https://api.github.com/repos/wmde/WikibaseDataModel/git/commits{/sha}","comments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/comments{/number}","issue_comment_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/comments{/number}","contents_url":"https://api.github.com/repos/wmde/WikibaseDataModel/contents/{+path}","compare_url":"https://api.github.com/repos/wmde/WikibaseDataModel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wmde/WikibaseDataModel/merges","archive_url":"https://api.github.com/repos/wmde/WikibaseDataModel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wmde/WikibaseDataModel/downloads","issues_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues{/number}","pulls_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls{/number}","milestones_url":"https://api.github.com/repos/wmde/WikibaseDataModel/milestones{/number}","notifications_url":"https://api.github.com/repos/wmde/WikibaseDataModel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wmde/WikibaseDataModel/labels{/name}","releases_url":"https://api.github.com/repos/wmde/WikibaseDataModel/releases{/id}","deployments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/deployments","created_at":"2013-12-11T15:20:51Z","updated_at":"2016-01-11T10:39:20Z","pushed_at":"2016-03-08T10:05:37Z","git_url":"git://github.com/wmde/WikibaseDataModel.git","ssh_url":"git@github.com:wmde/WikibaseDataModel.git","clone_url":"https://github.com/wmde/WikibaseDataModel.git","svn_url":"https://github.com/wmde/WikibaseDataModel","homepage":"http://wikiba.se/","size":2118,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":30,"forks":6,"open_issues":30,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645"},"html":{"href":"https://github.com/wmde/WikibaseDataModel/pull/645"},"issue":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/645"},"comments":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/645/comments"},"review_comments":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645/comments"},"review_comment":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/645/commits"},"statuses":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/statuses/626f094d10704c9185510b6ef455896bbdf00018"}}}}