{"action":"created","comment":{"url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments/52738901","id":52738901,"diff_hunk":"@@ -229,4 +230,37 @@ public function testPropertyWithStatementsIsNotEmpty() {\n \t\t$this->assertFalse( $property->isEmpty() );\n \t}\n \n+\tpublic function testClone() {\n+\t\t$id = new PropertyId( 'P1' );\n+\t\t$fingerprint = new Fingerprint();\n+\t\t$fingerprint->setLabel( 'en', 'original' );\n+\t\t$statement = new Statement( new PropertyNoValueSnak( 1 ) );\n+\t\t$statements = new StatementList( $statement );\n+\t\t$original = new Property( $id, $fingerprint, 'string', $statements );\n+\n+\t\t$clone = clone $original;\n+\n+\t\t// The clone must not reference the same mutable objects\n+\t\t$this->assertSame( 'property', $clone->getType() );\n+\t\t$this->assertSame( 'string', $clone->getDataTypeId() );\n+\t\t$this->assertSame( $id, $clone->getId(), 'id is immutable and must not be cloned' );\n+\t\t$this->assertNotSame( $fingerprint, $clone->getFingerprint() );\n+\t\t$this->assertNotSame( $statements, $clone->getStatements() );\n+\t\t$this->assertNotSame( $statement, $clone->getStatements()->toArray()[0] );","path":"tests/unit/Entity/PropertyTest.php","position":41,"original_position":41,"commit_id":"b0de0a0c81a20778bc1a71a72460183b67953d35","original_commit_id":"b0de0a0c81a20778bc1a71a72460183b67953d35","user":{"login":"Benestar","id":2998254,"avatar_url":"https://avatars.githubusercontent.com/u/2998254?v=3","gravatar_id":"","url":"https://api.github.com/users/Benestar","html_url":"https://github.com/Benestar","followers_url":"https://api.github.com/users/Benestar/followers","following_url":"https://api.github.com/users/Benestar/following{/other_user}","gists_url":"https://api.github.com/users/Benestar/gists{/gist_id}","starred_url":"https://api.github.com/users/Benestar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Benestar/subscriptions","organizations_url":"https://api.github.com/users/Benestar/orgs","repos_url":"https://api.github.com/users/Benestar/repos","events_url":"https://api.github.com/users/Benestar/events{/privacy}","received_events_url":"https://api.github.com/users/Benestar/received_events","type":"User","site_admin":false},"body":"Does not work in PHP 5.3","created_at":"2016-02-12T13:11:27Z","updated_at":"2016-02-12T13:11:27Z","html_url":"https://github.com/wmde/WikibaseDataModel/pull/626#discussion_r52738901","pull_request_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626","_links":{"self":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments/52738901"},"html":{"href":"https://github.com/wmde/WikibaseDataModel/pull/626#discussion_r52738901"},"pull_request":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626"}}},"pull_request":{"url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626","id":59153027,"html_url":"https://github.com/wmde/WikibaseDataModel/pull/626","diff_url":"https://github.com/wmde/WikibaseDataModel/pull/626.diff","patch_url":"https://github.com/wmde/WikibaseDataModel/pull/626.patch","issue_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/626","number":626,"state":"open","locked":false,"title":"[RFC] Implement __clone to fully support deep cloning","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":"Alternative to #625. Personally I prefer this one. It's the native PHP way of copying/(deep)cloning objects.\r\n\r\nI'm not totally happy with the test because it's so long.","created_at":"2016-02-12T10:02:42Z","updated_at":"2016-02-12T13:11:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c59e7358b46d27a9f6666a0e35025e0fef5cea0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626/commits","review_comments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626/comments","review_comment_url":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/626/comments","statuses_url":"https://api.github.com/repos/wmde/WikibaseDataModel/statuses/b0de0a0c81a20778bc1a71a72460183b67953d35","head":{"label":"wmde:deepCloning","ref":"deepCloning","sha":"b0de0a0c81a20778bc1a71a72460183b67953d35","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-02-12T10:02:42Z","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":2152,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":31,"forks":5,"open_issues":31,"watchers":10,"default_branch":"master"}},"base":{"label":"wmde:master","ref":"master","sha":"5923189edc733d5ac1fb0d851a5127281c61df95","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-02-12T10:02:42Z","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":2152,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":31,"forks":5,"open_issues":31,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626"},"html":{"href":"https://github.com/wmde/WikibaseDataModel/pull/626"},"issue":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/626"},"comments":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/issues/626/comments"},"review_comments":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626/comments"},"review_comment":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/pulls/626/commits"},"statuses":{"href":"https://api.github.com/repos/wmde/WikibaseDataModel/statuses/b0de0a0c81a20778bc1a71a72460183b67953d35"}}}}