Cache\Prefixed\PrefixedCachePool::save PHP Метод

save() публичный Метод

public save ( Psr\Cache\CacheItemInterface $item )
$item Psr\Cache\CacheItemInterface
    public function save(CacheItemInterface $item)
    {
        return $this->cachePool->save($item);
    }

Usage Example

Пример #1
0
 public function testSave()
 {
     $item = $this->getMockBuilder(CacheItemInterface::class)->getMock();
     $prefix = 'ns';
     $returnValue = true;
     $stub = $this->getHierarchyCacheStub();
     $stub->expects($this->once())->method('save')->with($item)->willReturn($returnValue);
     $pool = new PrefixedCachePool($stub, $prefix);
     $this->assertEquals($returnValue, $pool->save($item));
 }