{"action":"created","comment":{"url":"https://api.github.com/repos/api-platform/core/pulls/comments/58552461","id":58552461,"diff_hunk":"@@ -0,0 +1,94 @@\n+<?php\n+\n+/*\n+ * This file is part of the API Platform project.\n+ *\n+ * (c) Kévin Dunglas <dunglas@gmail.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace ApiPlatform\\Core\\Tests\\Metadata\\Resource\\Factory;\n+\n+use ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceNameCollectionFactoryInterface;\n+use ApiPlatform\\Core\\Metadata\\Resource\\Factory\\XmlResourceNameCollectionFactory;\n+use ApiPlatform\\Core\\Metadata\\Resource\\Factory\\YamlResourceNameCollectionFactory;\n+use ApiPlatform\\Core\\Metadata\\Resource\\ResourceNameCollection;\n+use ApiPlatform\\Core\\Metadata\\Resource\\ResourceMetadata;\n+use ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Entity\\ConfigDummy;\n+\n+use ApiPlatform\\Core\\Metadata\\Resource\\Factory\\XmlResourceMetadataFactory;\n+use ApiPlatform\\Core\\Metadata\\Resource\\Factory\\YamlResourceMetadataFactory;\n+use ApiPlatform\\Core\\Metadata\\Resource\\ConfigurationMap;\n+\n+class FileLoaderResourceNameCollectionFactoryTest extends \\PHPUnit_Framework_TestCase\n+{\n+    public function testHasResourceYaml()\n+    {\n+        $configPath = __DIR__.'/../../../Fixtures/TestBundle/Resources/config/resources.yml';\n+        $configurationMap = new ConfigurationMap();\n+        $ymlResourceNameCollectionFactory = new YamlResourceNameCollectionFactory([$configPath], $configurationMap);\n+\n+        $this->assertEquals($ymlResourceNameCollectionFactory->create(), new ResourceNameCollection([\n+            ConfigDummy::class\n+        ]));\n+\n+        $this->assertEquals($configurationMap->get(ConfigDummy::class), [\n+                'shortName' => 'thedummyshortname',\n+                'description' => 'Dummy resource',\n+                'class' => 'ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Entity\\ConfigDummy',\n+                'itemOperations' => ['my_op_name' => [], 'my_other_op_name' => []],\n+                'collectionOperations' => ['my_collection_op' => []],\n+                'iri' => 'someirischema'\n+        ]);\n+    }\n+\n+    public function testHasResourceXml()\n+    {\n+        \n+        $configPath = __DIR__.'/../../../Fixtures/TestBundle/Resources/config/resources.xml';\n+        $configurationMap = new ConfigurationMap();\n+        $xmlResourceNameCollectionFactory = new XmlResourceNameCollectionFactory([$configPath], $configurationMap);\n+\n+        $this->assertEquals($xmlResourceNameCollectionFactory->create(), new ResourceNameCollection([\n+            ConfigDummy::class\n+        ]));\n+\n+        $this->assertEquals($configurationMap->get(ConfigDummy::class), [\n+                'shortName' => 'thedummyshortname',\n+                'description' => 'Dummy resource',\n+                'class' => 'ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Entity\\ConfigDummy',\n+                'itemOperations' => ['my_op_name' => [], 'my_other_op_name' => []],\n+                'collectionOperations' => ['my_collection_op' => []],\n+                'iri' => 'someirischema'\n+        ]);\n+    }\n+\n+    public function testYamlCreateResourceMetadata()\n+    {\n+        $configPath = __DIR__.'/../../../Fixtures/TestBundle/Resources/config/resources.yml';\n+        $configurationMap = new ConfigurationMap();\n+        $yamlResourceNameCollectionFactory = new YamlResourceNameCollectionFactory([$configPath], $configurationMap);\n+        $yamlResourceNameCollectionFactory->create();\n+\n+        $resourceMetadataFactory = new YamlResourceMetadataFactory($configurationMap);\n+        $resourceMetadata = $resourceMetadataFactory->create(ConfigDummy::class);\n+\n+        $this->assertInstanceOf(ResourceMetadata::class, $resourceMetadata);\n+    }","path":"tests/Metadata/Resource/Factory/FileLoaderResourceNameCollectionFactoryTest.php","position":79,"original_position":79,"commit_id":"94634982474ac5bccef9b3e2e9d62778313d5323","original_commit_id":"94634982474ac5bccef9b3e2e9d62778313d5323","user":{"login":"soyuka","id":1321971,"avatar_url":"https://avatars.githubusercontent.com/u/1321971?v=3","gravatar_id":"","url":"https://api.github.com/users/soyuka","html_url":"https://github.com/soyuka","followers_url":"https://api.github.com/users/soyuka/followers","following_url":"https://api.github.com/users/soyuka/following{/other_user}","gists_url":"https://api.github.com/users/soyuka/gists{/gist_id}","starred_url":"https://api.github.com/users/soyuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyuka/subscriptions","organizations_url":"https://api.github.com/users/soyuka/orgs","repos_url":"https://api.github.com/users/soyuka/repos","events_url":"https://api.github.com/users/soyuka/events{/privacy}","received_events_url":"https://api.github.com/users/soyuka/received_events","type":"User","site_admin":false},"body":"@teohhanhui for example. \r\n\r\nNow I need to see if `createMetadata` should be kept in the `ResourceMetadataFactoryTrait`, which depends on the use of `Annotation/Resource` as a pre-metadata class (see https://github.com/api-platform/core/pull/490/commits/94634982474ac5bccef9b3e2e9d62778313d5323#r58549969).","created_at":"2016-04-05T14:54:33Z","updated_at":"2016-04-05T14:54:33Z","html_url":"https://github.com/api-platform/core/pull/490#discussion_r58552461","pull_request_url":"https://api.github.com/repos/api-platform/core/pulls/490","_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments/58552461"},"html":{"href":"https://github.com/api-platform/core/pull/490#discussion_r58552461"},"pull_request":{"href":"https://api.github.com/repos/api-platform/core/pulls/490"}}},"pull_request":{"url":"https://api.github.com/repos/api-platform/core/pulls/490","id":65123811,"html_url":"https://github.com/api-platform/core/pull/490","diff_url":"https://github.com/api-platform/core/pull/490.diff","patch_url":"https://github.com/api-platform/core/pull/490.patch","issue_url":"https://api.github.com/repos/api-platform/core/issues/490","number":490,"state":"open","locked":false,"title":"[WIP] File resource configuration (xml,yml) ","user":{"login":"soyuka","id":1321971,"avatar_url":"https://avatars.githubusercontent.com/u/1321971?v=3","gravatar_id":"","url":"https://api.github.com/users/soyuka","html_url":"https://github.com/soyuka","followers_url":"https://api.github.com/users/soyuka/followers","following_url":"https://api.github.com/users/soyuka/following{/other_user}","gists_url":"https://api.github.com/users/soyuka/gists{/gist_id}","starred_url":"https://api.github.com/users/soyuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyuka/subscriptions","organizations_url":"https://api.github.com/users/soyuka/orgs","repos_url":"https://api.github.com/users/soyuka/repos","events_url":"https://api.github.com/users/soyuka/events{/privacy}","received_events_url":"https://api.github.com/users/soyuka/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | no\r\n| Fixed tickets | #421\r\n| License       | MIT\r\n| Doc PR        | ∅","created_at":"2016-04-04T10:28:15Z","updated_at":"2016-04-05T14:54:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96ca87fa37148bf1adf75562a35f3f62f6252d29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/api-platform/core/pulls/490/commits","review_comments_url":"https://api.github.com/repos/api-platform/core/pulls/490/comments","review_comment_url":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/api-platform/core/issues/490/comments","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/94634982474ac5bccef9b3e2e9d62778313d5323","head":{"label":"soyuka:fileloader","ref":"fileloader","sha":"94634982474ac5bccef9b3e2e9d62778313d5323","user":{"login":"soyuka","id":1321971,"avatar_url":"https://avatars.githubusercontent.com/u/1321971?v=3","gravatar_id":"","url":"https://api.github.com/users/soyuka","html_url":"https://github.com/soyuka","followers_url":"https://api.github.com/users/soyuka/followers","following_url":"https://api.github.com/users/soyuka/following{/other_user}","gists_url":"https://api.github.com/users/soyuka/gists{/gist_id}","starred_url":"https://api.github.com/users/soyuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyuka/subscriptions","organizations_url":"https://api.github.com/users/soyuka/orgs","repos_url":"https://api.github.com/users/soyuka/repos","events_url":"https://api.github.com/users/soyuka/events{/privacy}","received_events_url":"https://api.github.com/users/soyuka/received_events","type":"User","site_admin":false},"repo":{"id":41291626,"name":"DunglasApiBundle","full_name":"soyuka/DunglasApiBundle","owner":{"login":"soyuka","id":1321971,"avatar_url":"https://avatars.githubusercontent.com/u/1321971?v=3","gravatar_id":"","url":"https://api.github.com/users/soyuka","html_url":"https://github.com/soyuka","followers_url":"https://api.github.com/users/soyuka/followers","following_url":"https://api.github.com/users/soyuka/following{/other_user}","gists_url":"https://api.github.com/users/soyuka/gists{/gist_id}","starred_url":"https://api.github.com/users/soyuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyuka/subscriptions","organizations_url":"https://api.github.com/users/soyuka/orgs","repos_url":"https://api.github.com/users/soyuka/repos","events_url":"https://api.github.com/users/soyuka/events{/privacy}","received_events_url":"https://api.github.com/users/soyuka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soyuka/DunglasApiBundle","description":"The Hypermedia REST API component of API Platform: JSON-LD and Hydra support, works with Symfony too","fork":true,"url":"https://api.github.com/repos/soyuka/DunglasApiBundle","forks_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/forks","keys_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/teams","hooks_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/hooks","issue_events_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/issues/events{/number}","events_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/events","assignees_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/assignees{/user}","branches_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/branches{/branch}","tags_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/tags","blobs_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/languages","stargazers_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/stargazers","contributors_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/contributors","subscribers_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/subscribers","subscription_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/subscription","commits_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/contents/{+path}","compare_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/merges","archive_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/downloads","issues_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/issues{/number}","pulls_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/labels{/name}","releases_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/releases{/id}","deployments_url":"https://api.github.com/repos/soyuka/DunglasApiBundle/deployments","created_at":"2015-08-24T08:32:34Z","updated_at":"2016-01-14T09:30:37Z","pushed_at":"2016-04-05T14:43:42Z","git_url":"git://github.com/soyuka/DunglasApiBundle.git","ssh_url":"git@github.com:soyuka/DunglasApiBundle.git","clone_url":"https://github.com/soyuka/DunglasApiBundle.git","svn_url":"https://github.com/soyuka/DunglasApiBundle","homepage":"https://api-platform.com","size":1746,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"api-platform:master","ref":"master","sha":"1fcc149e12904167abf56d5c6b2ab42bbbefe9ed","user":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars.githubusercontent.com/u/13420081?v=3","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"repo":{"id":29501260,"name":"core","full_name":"api-platform/core","owner":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars.githubusercontent.com/u/13420081?v=3","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/api-platform/core","description":"The Hypermedia REST API component of API Platform: JSON-LD and Hydra support, works with Symfony too","fork":false,"url":"https://api.github.com/repos/api-platform/core","forks_url":"https://api.github.com/repos/api-platform/core/forks","keys_url":"https://api.github.com/repos/api-platform/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/api-platform/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/api-platform/core/teams","hooks_url":"https://api.github.com/repos/api-platform/core/hooks","issue_events_url":"https://api.github.com/repos/api-platform/core/issues/events{/number}","events_url":"https://api.github.com/repos/api-platform/core/events","assignees_url":"https://api.github.com/repos/api-platform/core/assignees{/user}","branches_url":"https://api.github.com/repos/api-platform/core/branches{/branch}","tags_url":"https://api.github.com/repos/api-platform/core/tags","blobs_url":"https://api.github.com/repos/api-platform/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/api-platform/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/api-platform/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/api-platform/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/{sha}","languages_url":"https://api.github.com/repos/api-platform/core/languages","stargazers_url":"https://api.github.com/repos/api-platform/core/stargazers","contributors_url":"https://api.github.com/repos/api-platform/core/contributors","subscribers_url":"https://api.github.com/repos/api-platform/core/subscribers","subscription_url":"https://api.github.com/repos/api-platform/core/subscription","commits_url":"https://api.github.com/repos/api-platform/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/api-platform/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/api-platform/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/api-platform/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/api-platform/core/contents/{+path}","compare_url":"https://api.github.com/repos/api-platform/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/api-platform/core/merges","archive_url":"https://api.github.com/repos/api-platform/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/api-platform/core/downloads","issues_url":"https://api.github.com/repos/api-platform/core/issues{/number}","pulls_url":"https://api.github.com/repos/api-platform/core/pulls{/number}","milestones_url":"https://api.github.com/repos/api-platform/core/milestones{/number}","notifications_url":"https://api.github.com/repos/api-platform/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/api-platform/core/labels{/name}","releases_url":"https://api.github.com/repos/api-platform/core/releases{/id}","deployments_url":"https://api.github.com/repos/api-platform/core/deployments","created_at":"2015-01-19T23:05:56Z","updated_at":"2016-04-04T10:16:23Z","pushed_at":"2016-04-05T14:43:42Z","git_url":"git://github.com/api-platform/core.git","ssh_url":"git@github.com:api-platform/core.git","clone_url":"https://github.com/api-platform/core.git","svn_url":"https://github.com/api-platform/core","homepage":"https://api-platform.com/doc/1.0/api-bundle/","size":2073,"stargazers_count":304,"watchers_count":304,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"open_issues_count":92,"forks":79,"open_issues":92,"watchers":304,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/490"},"html":{"href":"https://github.com/api-platform/core/pull/490"},"issue":{"href":"https://api.github.com/repos/api-platform/core/issues/490"},"comments":{"href":"https://api.github.com/repos/api-platform/core/issues/490/comments"},"review_comments":{"href":"https://api.github.com/repos/api-platform/core/pulls/490/comments"},"review_comment":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/api-platform/core/pulls/490/commits"},"statuses":{"href":"https://api.github.com/repos/api-platform/core/statuses/94634982474ac5bccef9b3e2e9d62778313d5323"}}}}