{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/64555451","id":64555451,"diff_hunk":"@@ -0,0 +1,124 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.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 Symfony\\Component\\Cache\\Tests\\Adapter;\n+\n+use Psr\\Cache\\CacheItemInterface;\n+use Symfony\\Component\\Cache\\Adapter\\NullAdapter;\n+\n+class NullAdapterTest extends \\PHPUnit_Framework_TestCase\n+{\n+    public function createCachePool()\n+    {\n+        return new NullAdapter();\n+    }\n+\n+    public function testGetItem()\n+    {\n+        $adapter = $this->createCachePool();\n+\n+        $item = $adapter->getItem('key');\n+        $this->assertFalse($item->isHit());\n+        $this->assertNull($item->get(), \"Item's value must be null when isHit is false.\");\n+    }\n+\n+    public function testHasItem()\n+    {\n+        $this->assertFalse($this->createCachePool()->hasItem('key'));\n+    }\n+\n+    public function testGetItems()\n+    {\n+        $adapter = $this->createCachePool();\n+\n+        $keys = array('foo', 'bar', 'baz', 'biz');\n+\n+        /** @var CacheItemInterface[] $items */\n+        $items = $adapter->getItems($keys);\n+        $count = 0;\n+\n+        foreach ($items as $key => $item) {\n+            $itemKey = $item->getKey();\n+\n+            $this->assertEquals($itemKey, $key, 'Keys must be preserved when fetching multiple items');\n+            $this->assertTrue(in_array($key, $keys), 'Cache key can not change.');\n+            $this->assertFalse($item->isHit());\n+\n+            // Remove $key for $keys\n+            foreach ($keys as $k => $v) {\n+                if ($v === $key) {\n+                    unset($keys[$k]);\n+                }\n+            }\n+\n+            ++$count;\n+        }\n+\n+        $this->assertSame(4, $count);\n+    }\n+\n+    public function testIsHit()\n+    {\n+        $adapter = $this->createCachePool();\n+\n+        $item = $adapter->getItem('key');\n+        $this->assertFalse($item->isHit());\n+    }\n+\n+    public function testClear()\n+    {\n+        $this->assertTrue($this->createCachePool()->clear());\n+    }\n+\n+    public function testDeleteItem()\n+    {\n+        $this->assertTrue($this->createCachePool()->deleteItem('key'));\n+    }\n+\n+    public function testDeleteItems()\n+    {\n+        $this->assertTrue($this->createCachePool()->deleteItems(array('key', 'foo', 'bar')));\n+    }\n+\n+    public function testSave()\n+    {\n+        $adapter = $this->createCachePool();\n+\n+        $item = $adapter->getItem('key');\n+        $this->assertFalse($item->isHit());\n+        $this->assertNull($item->get(), \"Item's value must be null when isHit is false.\");\n+\n+        $this->assertFalse($adapter->save($item));\n+    }\n+\n+    public function testDeferredSave()\n+    {\n+        $adapter = $this->createCachePool();\n+\n+        $item = $adapter->getItem('key');\n+        $this->assertFalse($item->isHit());\n+        $this->assertNull($item->get(), \"Item's value must be null when isHit is false.\");\n+\n+        $this->assertFalse($adapter->saveDeferred($item));\n+    }\n+\n+    public function testCommit()\n+    {\n+        $adapter = $this->createCachePool();\n+\n+        $item = $adapter->getItem('key');\n+        $this->assertFalse($item->isHit());\n+        $this->assertNull($item->get(), \"Item's value must be null when isHit is false.\");","path":"src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php","position":30,"original_position":119,"commit_id":"a3e8e4d7c63cd35e55a1905f1079d09620d0f5fc","original_commit_id":"a3e8e4d7c63cd35e55a1905f1079d09620d0f5fc","user":{"login":"OskarStark","id":995707,"avatar_url":"https://avatars.githubusercontent.com/u/995707?v=3","gravatar_id":"","url":"https://api.github.com/users/OskarStark","html_url":"https://github.com/OskarStark","followers_url":"https://api.github.com/users/OskarStark/followers","following_url":"https://api.github.com/users/OskarStark/following{/other_user}","gists_url":"https://api.github.com/users/OskarStark/gists{/gist_id}","starred_url":"https://api.github.com/users/OskarStark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OskarStark/subscriptions","organizations_url":"https://api.github.com/users/OskarStark/orgs","repos_url":"https://api.github.com/users/OskarStark/repos","events_url":"https://api.github.com/users/OskarStark/events{/privacy}","received_events_url":"https://api.github.com/users/OskarStark/received_events","type":"User","site_admin":false},"body":"thank you for the feedback 👍 ","created_at":"2016-05-25T11:21:06Z","updated_at":"2016-05-25T11:21:06Z","html_url":"https://github.com/symfony/symfony/pull/18825#discussion_r64555451","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/18825","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/64555451"},"html":{"href":"https://github.com/symfony/symfony/pull/18825#discussion_r64555451"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18825"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/18825","id":70882925,"html_url":"https://github.com/symfony/symfony/pull/18825","diff_url":"https://github.com/symfony/symfony/pull/18825.diff","patch_url":"https://github.com/symfony/symfony/pull/18825.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18825","number":18825,"state":"open","locked":false,"title":"[Cache] Create NullAdapter to disable cache if needed","user":{"login":"tgalopin","id":1651494,"avatar_url":"https://avatars.githubusercontent.com/u/1651494?v=3","gravatar_id":"","url":"https://api.github.com/users/tgalopin","html_url":"https://github.com/tgalopin","followers_url":"https://api.github.com/users/tgalopin/followers","following_url":"https://api.github.com/users/tgalopin/following{/other_user}","gists_url":"https://api.github.com/users/tgalopin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgalopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgalopin/subscriptions","organizations_url":"https://api.github.com/users/tgalopin/orgs","repos_url":"https://api.github.com/users/tgalopin/repos","events_url":"https://api.github.com/users/tgalopin/events{/privacy}","received_events_url":"https://api.github.com/users/tgalopin/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | WIP\r\n| Fixed tickets | -\r\n| License       | MIT\r\n| Doc PR        | -\r\n\r\nTthis PR aims to implement a Symfony Cache Null adapter able to disable cache if needed (very useful in tests or in the case of the fallback of the OpCacheAdapter for instance).\r\n\r\nThis PR is required by https://github.com/symfony/symfony/pull/18823 and https://github.com/symfony/symfony/pull/18533","created_at":"2016-05-20T16:33:32Z","updated_at":"2016-05-25T11:21:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b69ea70b2d7ddc40d8aac71ed0f7616562ffbf48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/18825/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/18825/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18825/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/a3e8e4d7c63cd35e55a1905f1079d09620d0f5fc","head":{"label":"tgalopin:null-adapter","ref":"null-adapter","sha":"a3e8e4d7c63cd35e55a1905f1079d09620d0f5fc","user":{"login":"tgalopin","id":1651494,"avatar_url":"https://avatars.githubusercontent.com/u/1651494?v=3","gravatar_id":"","url":"https://api.github.com/users/tgalopin","html_url":"https://github.com/tgalopin","followers_url":"https://api.github.com/users/tgalopin/followers","following_url":"https://api.github.com/users/tgalopin/following{/other_user}","gists_url":"https://api.github.com/users/tgalopin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgalopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgalopin/subscriptions","organizations_url":"https://api.github.com/users/tgalopin/orgs","repos_url":"https://api.github.com/users/tgalopin/repos","events_url":"https://api.github.com/users/tgalopin/events{/privacy}","received_events_url":"https://api.github.com/users/tgalopin/received_events","type":"User","site_admin":false},"repo":{"id":40324575,"name":"symfony","full_name":"tgalopin/symfony","owner":{"login":"tgalopin","id":1651494,"avatar_url":"https://avatars.githubusercontent.com/u/1651494?v=3","gravatar_id":"","url":"https://api.github.com/users/tgalopin","html_url":"https://github.com/tgalopin","followers_url":"https://api.github.com/users/tgalopin/followers","following_url":"https://api.github.com/users/tgalopin/following{/other_user}","gists_url":"https://api.github.com/users/tgalopin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgalopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgalopin/subscriptions","organizations_url":"https://api.github.com/users/tgalopin/orgs","repos_url":"https://api.github.com/users/tgalopin/repos","events_url":"https://api.github.com/users/tgalopin/events{/privacy}","received_events_url":"https://api.github.com/users/tgalopin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tgalopin/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/tgalopin/symfony","forks_url":"https://api.github.com/repos/tgalopin/symfony/forks","keys_url":"https://api.github.com/repos/tgalopin/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgalopin/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgalopin/symfony/teams","hooks_url":"https://api.github.com/repos/tgalopin/symfony/hooks","issue_events_url":"https://api.github.com/repos/tgalopin/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/tgalopin/symfony/events","assignees_url":"https://api.github.com/repos/tgalopin/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/tgalopin/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/tgalopin/symfony/tags","blobs_url":"https://api.github.com/repos/tgalopin/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgalopin/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgalopin/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgalopin/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgalopin/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/tgalopin/symfony/languages","stargazers_url":"https://api.github.com/repos/tgalopin/symfony/stargazers","contributors_url":"https://api.github.com/repos/tgalopin/symfony/contributors","subscribers_url":"https://api.github.com/repos/tgalopin/symfony/subscribers","subscription_url":"https://api.github.com/repos/tgalopin/symfony/subscription","commits_url":"https://api.github.com/repos/tgalopin/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgalopin/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgalopin/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgalopin/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgalopin/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/tgalopin/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgalopin/symfony/merges","archive_url":"https://api.github.com/repos/tgalopin/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgalopin/symfony/downloads","issues_url":"https://api.github.com/repos/tgalopin/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/tgalopin/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/tgalopin/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/tgalopin/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgalopin/symfony/labels{/name}","releases_url":"https://api.github.com/repos/tgalopin/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/tgalopin/symfony/deployments","created_at":"2015-08-06T20:08:15Z","updated_at":"2016-01-22T16:31:30Z","pushed_at":"2016-05-20T16:52:23Z","git_url":"git://github.com/tgalopin/symfony.git","ssh_url":"git@github.com:tgalopin/symfony.git","clone_url":"https://github.com/tgalopin/symfony.git","svn_url":"https://github.com/tgalopin/symfony","homepage":"symfony.com","size":71072,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"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":"2.8"}},"base":{"label":"symfony:master","ref":"master","sha":"ea9d6e7235adb98cf6143cb89e6cdb2e86710944","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-05-25T09:59:46Z","pushed_at":"2016-05-25T10:21:34Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":131949,"stargazers_count":12398,"watchers_count":12398,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4848,"mirror_url":null,"open_issues_count":765,"forks":4848,"open_issues":765,"watchers":12398,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18825"},"html":{"href":"https://github.com/symfony/symfony/pull/18825"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/18825"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/18825/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18825/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18825/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/a3e8e4d7c63cd35e55a1905f1079d09620d0f5fc"}}}}
{"actor":{"display_login":"OskarStark"}}