* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Cache\Tests\Simple; use PHPUnit\Framework\TestCase; use Symfony\Component\Cache\Simple\NullCache; /** * @group time-sensitive */ class NullCacheTest extends TestCase { public function createCachePool() { return new NullCache(); } public function testGetItem() { $cache = $this->createCachePool(); $this->assertNull($cache->get('key')); } public function testHas() { $this->assertFalse($this->createCachePool()->has('key')); } public function testGetMultiple() { $cache = $this->createCachePool(); $keys = array('foo', 'bar', 'baz', 'biz'); $default = new \stdClass(); $items = $cache->getMultiple($keys, $default); $count = 0; foreach ($items as $key => $item) { $this->assertContains($key, $keys, 'Cache key can not change.'); $this->assertSame($default, $item); // Remove $key for $keys foreach ($keys as $k => $v) { if ($v === $key) { unset($keys[$k]); } } ++$count; } $this->assertSame(4, $count); } public function testClear() { $this->assertTrue($this->createCachePool()->clear()); } public function testDelete() { $this->assertTrue($this->createCachePool()->delete('key')); } public function testDeleteMultiple() { $this->assertTrue($this->createCachePool()->deleteMultiple(array('key', 'foo', 'bar'))); } public function testSet() { $cache = $this->createCachePool(); $this->assertFalse($cache->set('key', 'val')); $this->assertNull($cache->get('key')); } public function testSetMultiple() { $cache = $this->createCachePool(); $this->assertFalse($cache->setMultiple(array('key' => 'val'))); $this->assertNull($cache->get('key')); } } __halt_compiler();----SIGNATURE:----LRk7xZr+O5uxEFE569vq2ueZ33Sg1ahO137VoXV6Focxno7sLbd0rMGXZ0eQTpjfsS8ZXHSftmNu6SlsYGxILy++GoiU4qhNVXZSVxEpzPP4Tp20Z+M0KhTHH8BU+5xI/x9JYJynns34gk93FUrM0SoqBK+vEkD192Hd6d7w1bVVSWelAkPgPJx9UMa1/MGMrlx1k4Dom3nU0YI6IYn5/uonhx2IwTQO289h6rZdYcZJxhtUs1xvqUQ35JoNVTE4bamc+sNYl73WJIEgpjNlquIU9m0sOl6+eSZRyjAMA02a782zeCZE7J+wL6HUrOS3CcgkLdqbyf27fddtiew+22ytguhAwiOLhR88zr+H57b0TWFVG66jZogzQExpGaqRW+/nJofoWxY9wi/Eyuyl0hsGTza+eyMB3W9sW+vY6QDiBEVgB8ZeNAosPYtW2ucV26DFypJc+zCiBQFNj9oHLCTbejGPz8x4Px4WCq1Qd2tZeP4dhHz5VUQiZJ3DuB7NIQKut/izTe4ggEQvFAXvnoy9s9QK3CHj+lYf4w0yuX54q6IU0CLycig9J0NbQTvx3Z7RboInkhRrAZa9MFJIRM298SM/mkASJrU7AVDckDVaB+kVYG0NzCZDvJDFoQ3XAlPPz57Vda2g196l6O18/F34N/zdJ76h3Q+XcO3iCC8=----ATTACHMENT:----NTkzMzY4NTc2MTc2Mzg2NCAyMjYyNjAxMzkwOTY0OTMxIDE4NzM2MDg5OTAwNTg1MTE=