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']); }
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); }