{"action":"created","comment":{"url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/comments/54116337","id":54116337,"diff_hunk":"@@ -0,0 +1,63 @@\n+<?php\n+\n+/*\n+ * This file is part of Sulu.\n+ *\n+ * (c) MASSIVE ART WebServices GmbH\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+namespace Sulu\\Component\\DocumentManager\\Tests\\Unit;\n+\n+use Sulu\\Component\\DocumentManager\\DocumentInspector;\n+use Sulu\\Component\\DocumentManager\\DocumentInspectorFactory;\n+use Sulu\\Component\\DocumentManager\\DocumentManagerContext;\n+use Sulu\\Component\\DocumentManager\\DocumentRegistry;\n+use Sulu\\Component\\DocumentManager\\PathSegmentRegistry;\n+use Sulu\\Component\\DocumentManager\\ProxyFactory;\n+\n+class DocumentInspectorFactoryTest extends \\PHPUnit_Framework_TestCase\n+{\n+    /**\n+     * @var DocumentInspectorFactory\n+     */\n+    private $factory;\n+\n+    /**\n+     * @var PathSegmentRegistry\n+     */\n+    private $pathSegmentRegistry;\n+\n+    /**\n+     * @var DocumentRegistry\n+     */\n+    private $registry;\n+\n+    /**\n+     * @var ProxyFactory\n+     */\n+    private $proxyFactory;\n+\n+    public function setUp()\n+    {\n+        $this->pathSegmentRegistry = $this->prophesize(PathSegmentRegistry::class);\n+        $this->registry = $this->prophesize(DocumentRegistry::class);\n+        $this->proxyFactory = $this->prophesize(ProxyFactory::class);\n+        $this->context = $this->prophesize(DocumentManagerContext::class);\n+        $this->context->getRegistry()->willReturn($this->registry->reveal());\n+        $this->context->getProxyFactory()->willReturn($this->proxyFactory->reveal());","path":"tests/Unit/DocumentInspectorFactoryTest.php","position":50,"original_position":50,"commit_id":"beee515bcbe28a64f033267da17f73239ee96951","original_commit_id":"beee515bcbe28a64f033267da17f73239ee96951","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"contrent property.b","created_at":"2016-02-25T15:55:20Z","updated_at":"2016-02-25T15:55:20Z","html_url":"https://github.com/sulu-io/sulu-document-manager/pull/66#discussion_r54116337","pull_request_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/comments/54116337"},"html":{"href":"https://github.com/sulu-io/sulu-document-manager/pull/66#discussion_r54116337"},"pull_request":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66","id":60314580,"html_url":"https://github.com/sulu-io/sulu-document-manager/pull/66","diff_url":"https://github.com/sulu-io/sulu-document-manager/pull/66.diff","patch_url":"https://github.com/sulu-io/sulu-document-manager/pull/66.patch","issue_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/66","number":66,"state":"open","locked":false,"title":"[POC] Document context","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"This is the prototype for allowing multiple document manager instances.\r\n\r\nThis will allow consumers of this library to implement a document registry and retrieve different instances of the DocumentManager and each instance could be configured to use a different PHPCR repository.\r\n\r\nIn the context of Sulu this will be used to allow publishing from a `master` document manger to a `live` document manager which will be used when rendering the website.\r\n\r\nCurrently the Functional tests pass and the unit tests fail.\r\n\r\n- Introduces a `DocumentManagerContext` class which contains all of the dependencies required\r\n  for each individual DocumentManager.\r\n    - This is for the benefit of EventSubscribers, allowing them to remain stateless and un-duplicated. Each subscriber has access to the document manager (and the dependencies of) that emitted the event.\r\n- Introduces a `DocumentManagerRegistryInterface` (currently to be implemented by the user).\r\n\r\nPros\r\n----\r\n\r\n- No duplication of event subscriber instances.\r\n- Each DocumentManager encapsulates all of its dependencies.\r\n- Significantly reduces the number of dependencies that event subscribers have.\r\n\r\nCons\r\n----\r\n\r\n- 1 degree of separation: `$event->getContext()->getNodeManager()->find()`.\r\n- DocumentManager instantiates its own dependencies (but as it is basically an event dispatcher this doesn't matter so much).\r\n- We currently need to expose \"dependenceis\" of the document manager to other services through the API -- the documetn manager should not allow this. But this may be better a case for refactoring the client services.\r\n","created_at":"2016-02-23T10:02:02Z","updated_at":"2016-02-25T15:55:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9de7528532b67dcb78fe9241d38dcb68945d2504","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66/commits","review_comments_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66/comments","review_comment_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/66/comments","statuses_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/statuses/beee515bcbe28a64f033267da17f73239ee96951","head":{"label":"sulu-io:document_context","ref":"document_context","sha":"beee515bcbe28a64f033267da17f73239ee96951","user":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"repo":{"id":35034068,"name":"sulu-document-manager","full_name":"sulu-io/sulu-document-manager","owner":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-io/sulu-document-manager","description":"Sulu document manager","fork":false,"url":"https://api.github.com/repos/sulu-io/sulu-document-manager","forks_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/forks","keys_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/teams","hooks_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/hooks","issue_events_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/events","assignees_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/tags","blobs_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/languages","stargazers_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/stargazers","contributors_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/contributors","subscribers_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/subscribers","subscription_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/subscription","commits_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/merges","archive_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/downloads","issues_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/labels{/name}","releases_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/releases{/id}","deployments_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/deployments","created_at":"2015-05-04T12:42:07Z","updated_at":"2015-09-16T13:27:57Z","pushed_at":"2016-02-25T15:41:18Z","git_url":"git://github.com/sulu-io/sulu-document-manager.git","ssh_url":"git@github.com:sulu-io/sulu-document-manager.git","clone_url":"https://github.com/sulu-io/sulu-document-manager.git","svn_url":"https://github.com/sulu-io/sulu-document-manager","homepage":"sulu.io","size":578,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":20,"forks":2,"open_issues":20,"watchers":2,"default_branch":"master"}},"base":{"label":"sulu-io:develop","ref":"develop","sha":"e6512c2e882f39246b447510e459d43d16dbd6e6","user":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"repo":{"id":35034068,"name":"sulu-document-manager","full_name":"sulu-io/sulu-document-manager","owner":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-io/sulu-document-manager","description":"Sulu document manager","fork":false,"url":"https://api.github.com/repos/sulu-io/sulu-document-manager","forks_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/forks","keys_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/teams","hooks_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/hooks","issue_events_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/events","assignees_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/tags","blobs_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/languages","stargazers_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/stargazers","contributors_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/contributors","subscribers_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/subscribers","subscription_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/subscription","commits_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/merges","archive_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/downloads","issues_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/labels{/name}","releases_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/releases{/id}","deployments_url":"https://api.github.com/repos/sulu-io/sulu-document-manager/deployments","created_at":"2015-05-04T12:42:07Z","updated_at":"2015-09-16T13:27:57Z","pushed_at":"2016-02-25T15:41:18Z","git_url":"git://github.com/sulu-io/sulu-document-manager.git","ssh_url":"git@github.com:sulu-io/sulu-document-manager.git","clone_url":"https://github.com/sulu-io/sulu-document-manager.git","svn_url":"https://github.com/sulu-io/sulu-document-manager","homepage":"sulu.io","size":578,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":20,"forks":2,"open_issues":20,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66"},"html":{"href":"https://github.com/sulu-io/sulu-document-manager/pull/66"},"issue":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/66"},"comments":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/sulu-io/sulu-document-manager/statuses/beee515bcbe28a64f033267da17f73239ee96951"}}}}