{"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/79359126","id":79359126,"diff_hunk":"@@ -292,16 +292,84 @@ public function testDeleteLocation()\n     }\n \n     /**\n-     * Will create if not exists an simple content type for deletion test purpose with just and required field name.\n+     * Test that swapping locations affects properly Search Engine Index.\n+     */\n+    public function testSwapLocation()\n+    {\n+        $repository = $this->getRepository();\n+        $locationService = $repository->getLocationService();\n+        $searchService = $repository->getSearchService();\n+\n+        $content01 = $this->createContentWithName('content01', [2]);\n+        $location01 = $locationService->loadLocation($content01->contentInfo->mainLocationId);\n+\n+        $content02 = $this->createContentWithName('content02', [2]);\n+        $location02 = $locationService->loadLocation($content02->contentInfo->mainLocationId);\n+\n+        $locationService->swapLocation($location01, $location02);\n+        $this->refreshSearch($repository);\n+\n+        // content02 should be at location01\n+        $criterion = new Criterion\\LocationId($location01->id);\n+        $query = new Query(['filter' => $criterion]);\n+        $results = $searchService->findContent($query);\n+        $this->assertEquals(1, $results->totalCount);\n+        $this->assertEquals($content02->id, $results->searchHits[0]->valueObject->id);\n+\n+        // content01 should be at location02\n+        $criterion = new Criterion\\LocationId($location02->id);\n+        $query = new Query(['filter' => $criterion]);\n+        $results = $searchService->findContent($query);\n+        $this->assertEquals(1, $results->totalCount);\n+        $this->assertEquals($content01->id, $results->searchHits[0]->valueObject->id);\n+    }\n+\n+    /**\n+     * Test that updating Content metadata affects properly Search Engine Index.\n+     */\n+    public function testUpdateContentMetadata()\n+    {\n+        $repository = $this->getRepository();\n+        $contentService = $repository->getContentService();\n+        $locationService = $repository->getLocationService();\n+        $searchService = $repository->getSearchService();\n+\n+        $publishedContent = $this->createContentWithName('updateMetadataTest', [2]);\n+        $newLocationCreateStruct = $locationService->newLocationCreateStruct(60);\n+        $newLocation = $locationService->createLocation($publishedContent->contentInfo, $newLocationCreateStruct);\n+\n+        $newContentMetadataUpdateStruct = $contentService->newContentMetadataUpdateStruct();\n+        $newContentMetadataUpdateStruct->remoteId = md5('Test');\n+        $newContentMetadataUpdateStruct->publishedDate = new \\DateTime('+10m');\n+        $newContentMetadataUpdateStruct->mainLocationId = $newLocation->id;\n+\n+        $contentService->updateContentMetadata($publishedContent->contentInfo, $newContentMetadataUpdateStruct);\n+        $this->refreshSearch($repository);\n+\n+        $criterion = new Criterion\\ContentId($publishedContent->id);\n+        $query = new Query(['filter' => $criterion]);\n+        $results = $searchService->findContent($query);\n+        $this->assertEquals(1, $results->totalCount);\n+        $foundContent = $results->searchHits[0]->valueObject;\n+        /** @var \\eZ\\Publish\\Core\\Repository\\Values\\Content\\Content $foundContent */\n+        $this->assertEquals($publishedContent->id, $foundContent->id);\n+        $this->assertEquals($newContentMetadataUpdateStruct->publishedDate, $foundContent->contentInfo->publishedDate);\n+        $this->assertEquals($newLocation->id, $foundContent->contentInfo->mainLocationId);\n+        $this->assertEquals($newContentMetadataUpdateStruct->remoteId, $foundContent->contentInfo->remoteId);","path":"eZ/Publish/API/Repository/Tests/SearchEngineIndexingTest.php","position":null,"original_position":68,"commit_id":"ca6a24974e054848be0f19fe4efa547b0dfbed09","original_commit_id":"93f0628a23c3d902457b706f14fc2d57ae78b732","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"body":"thx, fixed tests in 0beb642 and now it works as expected","created_at":"2016-09-19T09:57:35Z","updated_at":"2016-09-19T09:57:35Z","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1779#discussion_r79359126","pull_request_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/79359126"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/1779#discussion_r79359126"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779"}}},"pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779","id":85192594,"html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1779","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1779.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1779.patch","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1779","number":1779,"state":"open","locked":false,"title":"[WIP] EZP-26219: Add missing Slots for Signals affecting Search Engine Index","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"body":"Status: **Work in progress**\r\nThis is a `v6.4` backport of #1776, related to JIRA issue [EZP-26219](https://jira.ez.no/browse/EZP-26219).\r\n\r\nThis PR adds some missing Search Engine slots for Signals affecting Search Engine Index.\r\n\r\n**TODO**:\r\n- [x] Add Search Engine `SwapLocation` Slot + unit test (0f70ab8)\r\n- [x] Add Search Engine `UpdateContentMetadata` Slot + unit test (0beb642)\r\n- [x] Add Search Engine `PublishContentTypeDraft` Slot + unit tests (ca6a249)\r\n- [ ] Identify other missing slots.\r\n","created_at":"2016-09-14T09:16:59Z","updated_at":"2016-09-19T09:57:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e4e95c02a7afbd9100b295398411645f9ae966d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779/commits","review_comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779/comments","review_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1779/comments","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/ca6a24974e054848be0f19fe4efa547b0dfbed09","head":{"label":"alongosz:ezp-26219-add-missing-search-slots-64-backport","ref":"ezp-26219-add-missing-search-slots-64-backport","sha":"ca6a24974e054848be0f19fe4efa547b0dfbed09","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"repo":{"id":58625909,"name":"ezpublish-kernel","full_name":"alongosz/ezpublish-kernel","owner":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alongosz/ezpublish-kernel","description":"eZ Platform (aka eZ Publish 6.x) kernel","fork":true,"url":"https://api.github.com/repos/alongosz/ezpublish-kernel","forks_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/releases{/id}","deployments_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/deployments","created_at":"2016-05-12T09:06:18Z","updated_at":"2016-05-12T09:06:28Z","pushed_at":"2016-09-19T09:23:00Z","git_url":"git://github.com/alongosz/ezpublish-kernel.git","ssh_url":"git@github.com:alongosz/ezpublish-kernel.git","clone_url":"https://github.com/alongosz/ezpublish-kernel.git","svn_url":"https://github.com/alongosz/ezpublish-kernel","homepage":"http://ezplatform.com/","size":45845,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"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":"ezsystems:6.4","ref":"6.4","sha":"37e75da8debab6f9b890a305e3b22c2759b4d50d","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":1663890,"name":"ezpublish-kernel","full_name":"ezsystems/ezpublish-kernel","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/ezpublish-kernel","description":"eZ Platform (aka eZ Publish 6.x) kernel","fork":false,"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","forks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/deployments","created_at":"2011-04-26T08:54:24Z","updated_at":"2016-08-22T16:14:44Z","pushed_at":"2016-09-19T09:24:21Z","git_url":"git://github.com/ezsystems/ezpublish-kernel.git","ssh_url":"git@github.com:ezsystems/ezpublish-kernel.git","clone_url":"https://github.com/ezsystems/ezpublish-kernel.git","svn_url":"https://github.com/ezsystems/ezpublish-kernel","homepage":"http://ezplatform.com/","size":51333,"stargazers_count":115,"watchers_count":115,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":163,"mirror_url":null,"open_issues_count":70,"forks":163,"open_issues":70,"watchers":115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/1779"},"issue":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1779"},"comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1779/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1779/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/ca6a24974e054848be0f19fe4efa547b0dfbed09"}}}}
{"actor":{"display_login":"alongosz"}}