{"action":"created","comment":{"url":"https://api.github.com/repos/fago/rules/pulls/comments/40286140","id":40286140,"diff_hunk":"@@ -39,17 +39,17 @@ public function setUp() {\n    */\n   public function testConditionEvaluation() {\n     // Test a ComplexDataInterface object.\n-    $entity_adapter_empty = $this->prophesize(ComplexDataInterface::class);\n-    $entity_adapter_empty->isEmpty()->willReturn(TRUE)->shouldBeCalledTimes(1);\n-\n-    $this->condition->getContext('data')->setContextData($entity_adapter_empty->reveal());\n-    $this->assertTrue($this->condition->evaluate());\n-\n-    $entity_adapter_full = $this->prophesize(ComplexDataInterface::class);\n-    $entity_adapter_full->isEmpty()->willReturn(FALSE)->shouldBeCalledTimes(1);\n-\n-    $this->condition->getContext('data')->setContextData($entity_adapter_full->reveal());\n-    $this->assertFalse($this->condition->evaluate());\n+    //$entity_adapter_empty = $this->prophesize(ComplexDataInterface::class);","path":"tests/src/Integration/Condition/DataIsEmptyTest.php","position":15,"original_position":15,"commit_id":"608ee2b511b19c863d55d0fe34ffa8b07855784d","original_commit_id":"608ee2b511b19c863d55d0fe34ffa8b07855784d","user":{"login":"torenware","id":322149,"avatar_url":"https://avatars.githubusercontent.com/u/322149?v=3","gravatar_id":"","url":"https://api.github.com/users/torenware","html_url":"https://github.com/torenware","followers_url":"https://api.github.com/users/torenware/followers","following_url":"https://api.github.com/users/torenware/following{/other_user}","gists_url":"https://api.github.com/users/torenware/gists{/gist_id}","starred_url":"https://api.github.com/users/torenware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torenware/subscriptions","organizations_url":"https://api.github.com/users/torenware/orgs","repos_url":"https://api.github.com/users/torenware/repos","events_url":"https://api.github.com/users/torenware/events{/privacy}","received_events_url":"https://api.github.com/users/torenware/received_events","type":"User","site_admin":false},"body":"What exactly are these mocks intended to test?\r\n\r\nAs I said before, the mocks need to change.  The following works, but I don't know if this tests what you really want tested:\r\n\r\n```php\r\n    // Test a ComplexDataInterface object.\r\n    $data_definition_interface = $this->prophesize(DataDefinitionInterface::class);\r\n    $data_definition_interface->getDataType()->willReturn('any');\r\n    \r\n    $entity_adapter_empty = $this->prophesize(ComplexDataInterface::class);\r\n    $entity_adapter_empty->getDataDefinition()->willReturn($data_definition_interface);\r\n    $entity_adapter_empty->getValue()->willReturn(FALSE);\r\n        \r\n    $this->condition->getContext('data')->setContextData($entity_adapter_empty->reveal());\r\n    $this->assertTrue($this->condition->evaluate());\r\n    \r\n    $entity_adapter_full = $this->prophesize(ComplexDataInterface::class);\r\n    $entity_adapter_full->getDataDefinition()->willReturn($data_definition_interface);\r\n    $entity_adapter_full->getValue()->willReturn(TRUE);\r\n    \r\n    $this->condition->getContext('data')->setContextData($entity_adapter_full->reveal());\r\n    $this->assertFalse($this->condition->evaluate());\r\n```\r\n\r\n`isEmpty()` has to go, because it really is never called:  by the time doEvaluate() sees the complex data, it's already been unwrapped to the data itself.  The call to `getValue()` has already done the conversion.\r\n\r\nWhat do you you guys want me to do here?","created_at":"2015-09-24T05:11:43Z","updated_at":"2015-09-24T05:11:43Z","html_url":"https://github.com/fago/rules/pull/235#discussion_r40286140","pull_request_url":"https://api.github.com/repos/fago/rules/pulls/235","_links":{"self":{"href":"https://api.github.com/repos/fago/rules/pulls/comments/40286140"},"html":{"href":"https://github.com/fago/rules/pull/235#discussion_r40286140"},"pull_request":{"href":"https://api.github.com/repos/fago/rules/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/fago/rules/pulls/235","id":45735483,"html_url":"https://github.com/fago/rules/pull/235","diff_url":"https://github.com/fago/rules/pull/235.diff","patch_url":"https://github.com/fago/rules/pull/235.patch","issue_url":"https://api.github.com/repos/fago/rules/issues/235","number":235,"state":"open","locked":false,"title":"Issue #2572945: doExecute / doEvaluate for DataIsEmpty","user":{"login":"torenware","id":322149,"avatar_url":"https://avatars.githubusercontent.com/u/322149?v=3","gravatar_id":"","url":"https://api.github.com/users/torenware","html_url":"https://github.com/torenware","followers_url":"https://api.github.com/users/torenware/followers","following_url":"https://api.github.com/users/torenware/following{/other_user}","gists_url":"https://api.github.com/users/torenware/gists{/gist_id}","starred_url":"https://api.github.com/users/torenware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torenware/subscriptions","organizations_url":"https://api.github.com/users/torenware/orgs","repos_url":"https://api.github.com/users/torenware/repos","events_url":"https://api.github.com/users/torenware/events{/privacy}","received_events_url":"https://api.github.com/users/torenware/received_events","type":"User","site_admin":false},"body":"Implementation of the modified plugin, and the modified test.\r\n\r\nThe test of complex data interfaces no longer works, and may not even be relevant anymore, since RuleConditionBase::evaluate() unwraps the data for us.  I've commented out that part of the test.","created_at":"2015-09-23T01:09:34Z","updated_at":"2015-09-24T05:11:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe14632e30ecce23e60a97fa2db36443a03f64c5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fago/rules/pulls/235/commits","review_comments_url":"https://api.github.com/repos/fago/rules/pulls/235/comments","review_comment_url":"https://api.github.com/repos/fago/rules/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fago/rules/issues/235/comments","statuses_url":"https://api.github.com/repos/fago/rules/statuses/608ee2b511b19c863d55d0fe34ffa8b07855784d","head":{"label":"torenware:DataIsEmpty-doEvaluate-2572945","ref":"DataIsEmpty-doEvaluate-2572945","sha":"608ee2b511b19c863d55d0fe34ffa8b07855784d","user":{"login":"torenware","id":322149,"avatar_url":"https://avatars.githubusercontent.com/u/322149?v=3","gravatar_id":"","url":"https://api.github.com/users/torenware","html_url":"https://github.com/torenware","followers_url":"https://api.github.com/users/torenware/followers","following_url":"https://api.github.com/users/torenware/following{/other_user}","gists_url":"https://api.github.com/users/torenware/gists{/gist_id}","starred_url":"https://api.github.com/users/torenware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torenware/subscriptions","organizations_url":"https://api.github.com/users/torenware/orgs","repos_url":"https://api.github.com/users/torenware/repos","events_url":"https://api.github.com/users/torenware/events{/privacy}","received_events_url":"https://api.github.com/users/torenware/received_events","type":"User","site_admin":false},"repo":{"id":20571734,"name":"rules","full_name":"torenware/rules","owner":{"login":"torenware","id":322149,"avatar_url":"https://avatars.githubusercontent.com/u/322149?v=3","gravatar_id":"","url":"https://api.github.com/users/torenware","html_url":"https://github.com/torenware","followers_url":"https://api.github.com/users/torenware/followers","following_url":"https://api.github.com/users/torenware/following{/other_user}","gists_url":"https://api.github.com/users/torenware/gists{/gist_id}","starred_url":"https://api.github.com/users/torenware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torenware/subscriptions","organizations_url":"https://api.github.com/users/torenware/orgs","repos_url":"https://api.github.com/users/torenware/repos","events_url":"https://api.github.com/users/torenware/events{/privacy}","received_events_url":"https://api.github.com/users/torenware/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/torenware/rules","description":"Rules 8.x-3.x development","fork":true,"url":"https://api.github.com/repos/torenware/rules","forks_url":"https://api.github.com/repos/torenware/rules/forks","keys_url":"https://api.github.com/repos/torenware/rules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torenware/rules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torenware/rules/teams","hooks_url":"https://api.github.com/repos/torenware/rules/hooks","issue_events_url":"https://api.github.com/repos/torenware/rules/issues/events{/number}","events_url":"https://api.github.com/repos/torenware/rules/events","assignees_url":"https://api.github.com/repos/torenware/rules/assignees{/user}","branches_url":"https://api.github.com/repos/torenware/rules/branches{/branch}","tags_url":"https://api.github.com/repos/torenware/rules/tags","blobs_url":"https://api.github.com/repos/torenware/rules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torenware/rules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torenware/rules/git/refs{/sha}","trees_url":"https://api.github.com/repos/torenware/rules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torenware/rules/statuses/{sha}","languages_url":"https://api.github.com/repos/torenware/rules/languages","stargazers_url":"https://api.github.com/repos/torenware/rules/stargazers","contributors_url":"https://api.github.com/repos/torenware/rules/contributors","subscribers_url":"https://api.github.com/repos/torenware/rules/subscribers","subscription_url":"https://api.github.com/repos/torenware/rules/subscription","commits_url":"https://api.github.com/repos/torenware/rules/commits{/sha}","git_commits_url":"https://api.github.com/repos/torenware/rules/git/commits{/sha}","comments_url":"https://api.github.com/repos/torenware/rules/comments{/number}","issue_comment_url":"https://api.github.com/repos/torenware/rules/issues/comments{/number}","contents_url":"https://api.github.com/repos/torenware/rules/contents/{+path}","compare_url":"https://api.github.com/repos/torenware/rules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torenware/rules/merges","archive_url":"https://api.github.com/repos/torenware/rules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torenware/rules/downloads","issues_url":"https://api.github.com/repos/torenware/rules/issues{/number}","pulls_url":"https://api.github.com/repos/torenware/rules/pulls{/number}","milestones_url":"https://api.github.com/repos/torenware/rules/milestones{/number}","notifications_url":"https://api.github.com/repos/torenware/rules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torenware/rules/labels{/name}","releases_url":"https://api.github.com/repos/torenware/rules/releases{/id}","created_at":"2014-06-06T17:12:24Z","updated_at":"2014-09-28T23:21:53Z","pushed_at":"2015-09-23T07:30:54Z","git_url":"git://github.com/torenware/rules.git","ssh_url":"git@github.com:torenware/rules.git","clone_url":"https://github.com/torenware/rules.git","svn_url":"https://github.com/torenware/rules","homepage":null,"size":3156,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"8.x-3.x"}},"base":{"label":"fago:8.x-3.x","ref":"8.x-3.x","sha":"600067f0e8d24e129fe723cbcdc50f230c359ca9","user":{"login":"fago","id":132232,"avatar_url":"https://avatars.githubusercontent.com/u/132232?v=3","gravatar_id":"","url":"https://api.github.com/users/fago","html_url":"https://github.com/fago","followers_url":"https://api.github.com/users/fago/followers","following_url":"https://api.github.com/users/fago/following{/other_user}","gists_url":"https://api.github.com/users/fago/gists{/gist_id}","starred_url":"https://api.github.com/users/fago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fago/subscriptions","organizations_url":"https://api.github.com/users/fago/orgs","repos_url":"https://api.github.com/users/fago/repos","events_url":"https://api.github.com/users/fago/events{/privacy}","received_events_url":"https://api.github.com/users/fago/received_events","type":"User","site_admin":false},"repo":{"id":18917483,"name":"rules","full_name":"fago/rules","owner":{"login":"fago","id":132232,"avatar_url":"https://avatars.githubusercontent.com/u/132232?v=3","gravatar_id":"","url":"https://api.github.com/users/fago","html_url":"https://github.com/fago","followers_url":"https://api.github.com/users/fago/followers","following_url":"https://api.github.com/users/fago/following{/other_user}","gists_url":"https://api.github.com/users/fago/gists{/gist_id}","starred_url":"https://api.github.com/users/fago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fago/subscriptions","organizations_url":"https://api.github.com/users/fago/orgs","repos_url":"https://api.github.com/users/fago/repos","events_url":"https://api.github.com/users/fago/events{/privacy}","received_events_url":"https://api.github.com/users/fago/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fago/rules","description":"Rules 8.x-3.x development","fork":false,"url":"https://api.github.com/repos/fago/rules","forks_url":"https://api.github.com/repos/fago/rules/forks","keys_url":"https://api.github.com/repos/fago/rules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fago/rules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fago/rules/teams","hooks_url":"https://api.github.com/repos/fago/rules/hooks","issue_events_url":"https://api.github.com/repos/fago/rules/issues/events{/number}","events_url":"https://api.github.com/repos/fago/rules/events","assignees_url":"https://api.github.com/repos/fago/rules/assignees{/user}","branches_url":"https://api.github.com/repos/fago/rules/branches{/branch}","tags_url":"https://api.github.com/repos/fago/rules/tags","blobs_url":"https://api.github.com/repos/fago/rules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fago/rules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fago/rules/git/refs{/sha}","trees_url":"https://api.github.com/repos/fago/rules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fago/rules/statuses/{sha}","languages_url":"https://api.github.com/repos/fago/rules/languages","stargazers_url":"https://api.github.com/repos/fago/rules/stargazers","contributors_url":"https://api.github.com/repos/fago/rules/contributors","subscribers_url":"https://api.github.com/repos/fago/rules/subscribers","subscription_url":"https://api.github.com/repos/fago/rules/subscription","commits_url":"https://api.github.com/repos/fago/rules/commits{/sha}","git_commits_url":"https://api.github.com/repos/fago/rules/git/commits{/sha}","comments_url":"https://api.github.com/repos/fago/rules/comments{/number}","issue_comment_url":"https://api.github.com/repos/fago/rules/issues/comments{/number}","contents_url":"https://api.github.com/repos/fago/rules/contents/{+path}","compare_url":"https://api.github.com/repos/fago/rules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fago/rules/merges","archive_url":"https://api.github.com/repos/fago/rules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fago/rules/downloads","issues_url":"https://api.github.com/repos/fago/rules/issues{/number}","pulls_url":"https://api.github.com/repos/fago/rules/pulls{/number}","milestones_url":"https://api.github.com/repos/fago/rules/milestones{/number}","notifications_url":"https://api.github.com/repos/fago/rules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fago/rules/labels{/name}","releases_url":"https://api.github.com/repos/fago/rules/releases{/id}","created_at":"2014-04-18T15:49:13Z","updated_at":"2015-09-12T08:17:41Z","pushed_at":"2015-09-23T13:43:00Z","git_url":"git://github.com/fago/rules.git","ssh_url":"git@github.com:fago/rules.git","clone_url":"https://github.com/fago/rules.git","svn_url":"https://github.com/fago/rules","homepage":null,"size":5943,"stargazers_count":28,"watchers_count":28,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":79,"mirror_url":null,"open_issues_count":15,"forks":79,"open_issues":15,"watchers":28,"default_branch":"8.x-3.x"}},"_links":{"self":{"href":"https://api.github.com/repos/fago/rules/pulls/235"},"html":{"href":"https://github.com/fago/rules/pull/235"},"issue":{"href":"https://api.github.com/repos/fago/rules/issues/235"},"comments":{"href":"https://api.github.com/repos/fago/rules/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/fago/rules/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/fago/rules/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fago/rules/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/fago/rules/statuses/608ee2b511b19c863d55d0fe34ffa8b07855784d"}}}}