* * 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:----VUriIXJpAahhbfHuTce3mF+l6NHAk/7qu0I8TZPvZYgRu4JJs5nd5ddpxVV6dVPUNd9onqSdNSQv+VIjeuKz467UwK5Qx7pqDry++J0i/I94xYj6MaNCuHIosJewk3Mkijje9KGsSq3PgWAS2MVp//mVz9ZQ4vP04egzRXxoVwAQH8jtV3P6ViKbJSS3acjcTXC75h1RA6Qi+zFqHlSa0T8QQX40LWeUahE10lDgEOghzbTt8M7OcMW6bVbQap/pMwdj2ppEIm3W8vk3WadS76BDj8G4mxx4QOXIXceF9MjkNHVCySu15DdFVkT19g3oIEAf57ThvlX0e8n3jziDyosjsl84tmYGXmHve84VnfFa7ePWLVomYCtBXdO8IftvgzrenPUYleBLjz1QYg5N6sCG5VHk7PUSVFIW+B1vEae58EDv3fpYHh4FfSbX5nTistIchAiv7lPaZD75aGfe5c8IIugDrkeTFGquztRryCv4qn/91EESQPHfVVm0S/aAWX+b+tunB8ZNN94v0cIwQt+HyjH1FDJb1njiuxTupb8an30p4hrKdKE96yi/D7vHLcqYV6P/iSih5eth6vmuZIuBBx65Yzf+cC47VTgx2nztMUuWCO8ArzhhphksDKPJaNMCT+1KplD26A3/4ZXX/ay6hlx/2HFurHZyStaht7Q=----ATTACHMENT:----MTY1MjQ2Mjc2MzMxNzA1NiA0MTc4ODE0MjAyMTYyODQ2IDU5MzA4MjQzMjc0NDAwODg=