public function testAddToLinkedList() { $instance = new Container('Foo'); $instance->addToLinkedList('Bar'); $instance->addToLinkedList('Bar'); $this->assertEquals(array('Bar'), $instance->getLinkedList()); }
public function testHasAndDelete() { $expected = array('Bar' => new \stdClass()); $instance = new Container('Foo', $expected); $this->assertTrue($instance->has('Bar')); $instance->delete('Bar'); $this->assertFalse($instance->has('Bar')); }
public function testSaveContainerWithExpiry() { $container = array('Foobar', new \stdClass(), array()); $this->cache->expects($this->once())->method('save')->with($this->equalTo('Foo:bar'), $this->anything(), $this->equalTo(42)); $container = new Container('Foo:bar', $container); $container->setExpiryInSeconds(42); $instance = new BlobStore('Foo', $this->cache); $instance->save($container); }
/** * @since 1.0 * * @param Container $container */ public function save(Container $container) { $this->internalCache->save($container->getId(), $container->getData(), $container->getExpiry()); $this->cache->save($container->getId(), serialize($container->getData()), $container->getExpiry()); unset($container); }