{"action":"created","comment":{"url":"https://api.github.com/repos/ruflin/Elastica/pulls/comments/25098235","id":25098235,"diff_hunk":"@@ -0,0 +1,45 @@\n+<?php\n+\n+namespace Elastica\\Test\\Query;\n+\n+use Elastica\\Index;\n+use Elastica\\Query\\Image;\n+use Elastica\\Test\\Base as BaseTest;\n+use Elastica\\Type;\n+\n+class ImageTest extends BaseTest\n+{\n+    public function testToArrayFromReference()\n+    {\n+        $client = $this->_getClient();\n+        $index = new Index($client, 'test');\n+        $type = new Type($index, 'helloworld');\n+        $field = \"image\";\n+\n+        $query = new Image();\n+        $query->setFieldFeature($field, 'CEDD');\n+        $query->setFieldHash($field, 'BIT_SAMPLING');\n+        $query->setFieldBoost($field, 100);\n+\n+        $query->setImageByReference($field, $index->getName(), $type->getName(), 10);\n+\n+        $jsonString = '{\"image\":{\"image\":{\"feature\":\"CEDD\",\"hash\":\"BIT_SAMPLING\",\"boost\":100,\"index\":\"test\",\"type\":\"helloworld\",\"id\":10,\"path\":\"image\"}}}';\n+        $this->assertEquals($jsonString, json_encode($query->toArray()));\n+    }\n+\n+    public function testToArrayFromImage()\n+    {\n+        $field = \"image\";\n+\n+        $query = new Image();\n+        $query->setFieldFeature($field, 'CEDD');\n+        $query->setFieldHash($field, 'BIT_SAMPLING');\n+        $query->setFieldBoost($field, 100);\n+\n+        $query->setFieldImage($field, __DIR__ . '/../../../../data/test.jpg');","path":"test/lib/Elastica/Test/Query/ImageTest.php","position":39,"original_position":39,"commit_id":"5f4d901dd2675ac7dbbada7fe6724348cc5722be","original_commit_id":"5f4d901dd2675ac7dbbada7fe6724348cc5722be","user":{"login":"ruflin","id":244900,"avatar_url":"https://avatars.githubusercontent.com/u/244900?v=3","gravatar_id":"","url":"https://api.github.com/users/ruflin","html_url":"https://github.com/ruflin","followers_url":"https://api.github.com/users/ruflin/followers","following_url":"https://api.github.com/users/ruflin/following{/other_user}","gists_url":"https://api.github.com/users/ruflin/gists{/gist_id}","starred_url":"https://api.github.com/users/ruflin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruflin/subscriptions","organizations_url":"https://api.github.com/users/ruflin/orgs","repos_url":"https://api.github.com/users/ruflin/repos","events_url":"https://api.github.com/users/ruflin/events{/privacy}","received_events_url":"https://api.github.com/users/ruflin/received_events","type":"User","site_admin":false},"body":"To have a more readable path, check here: https://github.com/ruflin/Elastica/blob/master/test/lib/Elastica/Test/IndexTest.php#L124","created_at":"2015-02-20T20:00:12Z","updated_at":"2015-02-20T20:00:12Z","html_url":"https://github.com/ruflin/Elastica/pull/787#discussion_r25098235","pull_request_url":"https://api.github.com/repos/ruflin/Elastica/pulls/787","_links":{"self":{"href":"https://api.github.com/repos/ruflin/Elastica/pulls/comments/25098235"},"html":{"href":"https://github.com/ruflin/Elastica/pull/787#discussion_r25098235"},"pull_request":{"href":"https://api.github.com/repos/ruflin/Elastica/pulls/787"}}},"pull_request":{"url":"https://api.github.com/repos/ruflin/Elastica/pulls/787","id":29701299,"html_url":"https://github.com/ruflin/Elastica/pull/787","diff_url":"https://github.com/ruflin/Elastica/pull/787.diff","patch_url":"https://github.com/ruflin/Elastica/pull/787.patch","issue_url":"https://api.github.com/repos/ruflin/Elastica/issues/787","number":787,"state":"open","locked":false,"title":"Add Elastica\\Query\\Image","user":{"login":"Jmoati","id":798295,"avatar_url":"https://avatars.githubusercontent.com/u/798295?v=3","gravatar_id":"","url":"https://api.github.com/users/Jmoati","html_url":"https://github.com/Jmoati","followers_url":"https://api.github.com/users/Jmoati/followers","following_url":"https://api.github.com/users/Jmoati/following{/other_user}","gists_url":"https://api.github.com/users/Jmoati/gists{/gist_id}","starred_url":"https://api.github.com/users/Jmoati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jmoati/subscriptions","organizations_url":"https://api.github.com/users/Jmoati/orgs","repos_url":"https://api.github.com/users/Jmoati/repos","events_url":"https://api.github.com/users/Jmoati/events{/privacy}","received_events_url":"https://api.github.com/users/Jmoati/received_events","type":"User","site_admin":false},"body":"Add support of https://github.com/kzwang/elasticsearch-image","created_at":"2015-02-20T14:54:03Z","updated_at":"2015-02-20T20:00:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a17712776722f4b1e5ba71550b2a36699513a4dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ruflin/Elastica/pulls/787/commits","review_comments_url":"https://api.github.com/repos/ruflin/Elastica/pulls/787/comments","review_comment_url":"https://api.github.com/repos/ruflin/Elastica/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ruflin/Elastica/issues/787/comments","statuses_url":"https://api.github.com/repos/ruflin/Elastica/statuses/5f4d901dd2675ac7dbbada7fe6724348cc5722be","head":{"label":"Jmoati:master","ref":"master","sha":"5f4d901dd2675ac7dbbada7fe6724348cc5722be","user":{"login":"Jmoati","id":798295,"avatar_url":"https://avatars.githubusercontent.com/u/798295?v=3","gravatar_id":"","url":"https://api.github.com/users/Jmoati","html_url":"https://github.com/Jmoati","followers_url":"https://api.github.com/users/Jmoati/followers","following_url":"https://api.github.com/users/Jmoati/following{/other_user}","gists_url":"https://api.github.com/users/Jmoati/gists{/gist_id}","starred_url":"https://api.github.com/users/Jmoati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jmoati/subscriptions","organizations_url":"https://api.github.com/users/Jmoati/orgs","repos_url":"https://api.github.com/users/Jmoati/repos","events_url":"https://api.github.com/users/Jmoati/events{/privacy}","received_events_url":"https://api.github.com/users/Jmoati/received_events","type":"User","site_admin":false},"repo":{"id":30919376,"name":"Elastica","full_name":"Jmoati/Elastica","owner":{"login":"Jmoati","id":798295,"avatar_url":"https://avatars.githubusercontent.com/u/798295?v=3","gravatar_id":"","url":"https://api.github.com/users/Jmoati","html_url":"https://github.com/Jmoati","followers_url":"https://api.github.com/users/Jmoati/followers","following_url":"https://api.github.com/users/Jmoati/following{/other_user}","gists_url":"https://api.github.com/users/Jmoati/gists{/gist_id}","starred_url":"https://api.github.com/users/Jmoati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jmoati/subscriptions","organizations_url":"https://api.github.com/users/Jmoati/orgs","repos_url":"https://api.github.com/users/Jmoati/repos","events_url":"https://api.github.com/users/Jmoati/events{/privacy}","received_events_url":"https://api.github.com/users/Jmoati/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jmoati/Elastica","description":"Elastica is a PHP client for elasticsearch","fork":true,"url":"https://api.github.com/repos/Jmoati/Elastica","forks_url":"https://api.github.com/repos/Jmoati/Elastica/forks","keys_url":"https://api.github.com/repos/Jmoati/Elastica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jmoati/Elastica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jmoati/Elastica/teams","hooks_url":"https://api.github.com/repos/Jmoati/Elastica/hooks","issue_events_url":"https://api.github.com/repos/Jmoati/Elastica/issues/events{/number}","events_url":"https://api.github.com/repos/Jmoati/Elastica/events","assignees_url":"https://api.github.com/repos/Jmoati/Elastica/assignees{/user}","branches_url":"https://api.github.com/repos/Jmoati/Elastica/branches{/branch}","tags_url":"https://api.github.com/repos/Jmoati/Elastica/tags","blobs_url":"https://api.github.com/repos/Jmoati/Elastica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jmoati/Elastica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jmoati/Elastica/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jmoati/Elastica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jmoati/Elastica/statuses/{sha}","languages_url":"https://api.github.com/repos/Jmoati/Elastica/languages","stargazers_url":"https://api.github.com/repos/Jmoati/Elastica/stargazers","contributors_url":"https://api.github.com/repos/Jmoati/Elastica/contributors","subscribers_url":"https://api.github.com/repos/Jmoati/Elastica/subscribers","subscription_url":"https://api.github.com/repos/Jmoati/Elastica/subscription","commits_url":"https://api.github.com/repos/Jmoati/Elastica/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jmoati/Elastica/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jmoati/Elastica/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jmoati/Elastica/issues/comments/{number}","contents_url":"https://api.github.com/repos/Jmoati/Elastica/contents/{+path}","compare_url":"https://api.github.com/repos/Jmoati/Elastica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jmoati/Elastica/merges","archive_url":"https://api.github.com/repos/Jmoati/Elastica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jmoati/Elastica/downloads","issues_url":"https://api.github.com/repos/Jmoati/Elastica/issues{/number}","pulls_url":"https://api.github.com/repos/Jmoati/Elastica/pulls{/number}","milestones_url":"https://api.github.com/repos/Jmoati/Elastica/milestones{/number}","notifications_url":"https://api.github.com/repos/Jmoati/Elastica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jmoati/Elastica/labels{/name}","releases_url":"https://api.github.com/repos/Jmoati/Elastica/releases{/id}","created_at":"2015-02-17T14:02:18Z","updated_at":"2015-02-20T14:52:55Z","pushed_at":"2015-02-20T14:52:54Z","git_url":"git://github.com/Jmoati/Elastica.git","ssh_url":"git@github.com:Jmoati/Elastica.git","clone_url":"https://github.com/Jmoati/Elastica.git","svn_url":"https://github.com/Jmoati/Elastica","homepage":"http://elastica.io/","size":51377,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ruflin:master","ref":"master","sha":"7f62b40e58a76be0f5b16fe2f7d09a4d2080899e","user":{"login":"ruflin","id":244900,"avatar_url":"https://avatars.githubusercontent.com/u/244900?v=3","gravatar_id":"","url":"https://api.github.com/users/ruflin","html_url":"https://github.com/ruflin","followers_url":"https://api.github.com/users/ruflin/followers","following_url":"https://api.github.com/users/ruflin/following{/other_user}","gists_url":"https://api.github.com/users/ruflin/gists{/gist_id}","starred_url":"https://api.github.com/users/ruflin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruflin/subscriptions","organizations_url":"https://api.github.com/users/ruflin/orgs","repos_url":"https://api.github.com/users/ruflin/repos","events_url":"https://api.github.com/users/ruflin/events{/privacy}","received_events_url":"https://api.github.com/users/ruflin/received_events","type":"User","site_admin":false},"repo":{"id":1006445,"name":"Elastica","full_name":"ruflin/Elastica","owner":{"login":"ruflin","id":244900,"avatar_url":"https://avatars.githubusercontent.com/u/244900?v=3","gravatar_id":"","url":"https://api.github.com/users/ruflin","html_url":"https://github.com/ruflin","followers_url":"https://api.github.com/users/ruflin/followers","following_url":"https://api.github.com/users/ruflin/following{/other_user}","gists_url":"https://api.github.com/users/ruflin/gists{/gist_id}","starred_url":"https://api.github.com/users/ruflin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruflin/subscriptions","organizations_url":"https://api.github.com/users/ruflin/orgs","repos_url":"https://api.github.com/users/ruflin/repos","events_url":"https://api.github.com/users/ruflin/events{/privacy}","received_events_url":"https://api.github.com/users/ruflin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ruflin/Elastica","description":"Elastica is a PHP client for elasticsearch","fork":false,"url":"https://api.github.com/repos/ruflin/Elastica","forks_url":"https://api.github.com/repos/ruflin/Elastica/forks","keys_url":"https://api.github.com/repos/ruflin/Elastica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruflin/Elastica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruflin/Elastica/teams","hooks_url":"https://api.github.com/repos/ruflin/Elastica/hooks","issue_events_url":"https://api.github.com/repos/ruflin/Elastica/issues/events{/number}","events_url":"https://api.github.com/repos/ruflin/Elastica/events","assignees_url":"https://api.github.com/repos/ruflin/Elastica/assignees{/user}","branches_url":"https://api.github.com/repos/ruflin/Elastica/branches{/branch}","tags_url":"https://api.github.com/repos/ruflin/Elastica/tags","blobs_url":"https://api.github.com/repos/ruflin/Elastica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruflin/Elastica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruflin/Elastica/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruflin/Elastica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruflin/Elastica/statuses/{sha}","languages_url":"https://api.github.com/repos/ruflin/Elastica/languages","stargazers_url":"https://api.github.com/repos/ruflin/Elastica/stargazers","contributors_url":"https://api.github.com/repos/ruflin/Elastica/contributors","subscribers_url":"https://api.github.com/repos/ruflin/Elastica/subscribers","subscription_url":"https://api.github.com/repos/ruflin/Elastica/subscription","commits_url":"https://api.github.com/repos/ruflin/Elastica/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruflin/Elastica/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruflin/Elastica/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruflin/Elastica/issues/comments/{number}","contents_url":"https://api.github.com/repos/ruflin/Elastica/contents/{+path}","compare_url":"https://api.github.com/repos/ruflin/Elastica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruflin/Elastica/merges","archive_url":"https://api.github.com/repos/ruflin/Elastica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruflin/Elastica/downloads","issues_url":"https://api.github.com/repos/ruflin/Elastica/issues{/number}","pulls_url":"https://api.github.com/repos/ruflin/Elastica/pulls{/number}","milestones_url":"https://api.github.com/repos/ruflin/Elastica/milestones{/number}","notifications_url":"https://api.github.com/repos/ruflin/Elastica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruflin/Elastica/labels{/name}","releases_url":"https://api.github.com/repos/ruflin/Elastica/releases{/id}","created_at":"2010-10-19T17:04:21Z","updated_at":"2015-02-19T13:22:53Z","pushed_at":"2015-02-19T09:51:36Z","git_url":"git://github.com/ruflin/Elastica.git","ssh_url":"git@github.com:ruflin/Elastica.git","clone_url":"https://github.com/ruflin/Elastica.git","svn_url":"https://github.com/ruflin/Elastica","homepage":"http://elastica.io/","size":51377,"stargazers_count":888,"watchers_count":888,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":340,"mirror_url":null,"open_issues_count":91,"forks":340,"open_issues":91,"watchers":888,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruflin/Elastica/pulls/787"},"html":{"href":"https://github.com/ruflin/Elastica/pull/787"},"issue":{"href":"https://api.github.com/repos/ruflin/Elastica/issues/787"},"comments":{"href":"https://api.github.com/repos/ruflin/Elastica/issues/787/comments"},"review_comments":{"href":"https://api.github.com/repos/ruflin/Elastica/pulls/787/comments"},"review_comment":{"href":"https://api.github.com/repos/ruflin/Elastica/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ruflin/Elastica/pulls/787/commits"},"statuses":{"href":"https://api.github.com/repos/ruflin/Elastica/statuses/5f4d901dd2675ac7dbbada7fe6724348cc5722be"}}}}