Exemplo n.º 1
0
 public function testAddToLinkedList()
 {
     $instance = new Container('Foo');
     $instance->addToLinkedList('Bar');
     $instance->addToLinkedList('Bar');
     $this->assertEquals(array('Bar'), $instance->getLinkedList());
 }
Exemplo n.º 2
0
 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'));
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 /**
  * @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);
 }