Exemplo n.º 1
0
 public function testUpgradeBehaviors()
 {
     $storage = $this->manager->getStorage();
     $storage['foo'] = new \ArrayObject(array('bar' => 'baz'));
     $container = new Container('foo', $this->manager);
     $this->assertEquals('baz', $container->bar);
     $container->baz = 'boo';
     $this->assertEquals('boo', $storage['foo']['baz']);
 }
Exemplo n.º 2
0
 public function testIterationHonorsExpirationTimestamps()
 {
     $this->container->foo = 'bar';
     $this->container->bar = 'baz';
     $storage = $this->manager->getStorage();
     $storage->setMetadata('Default', array('EXPIRE_KEYS' => array('foo' => $_SERVER['REQUEST_TIME'] - 18600)));
     $expected = array('bar' => 'baz');
     $test = array();
     foreach ($this->container as $key => $value) {
         $test[$key] = $value;
     }
     $this->assertSame($expected, $test);
 }