public function testToArrayWithMetaData() { $this->storage->foo = 'bar'; $this->storage->bar = 'baz'; $this->storage->setMetadata('foo', 'bar'); $expected = array('__ZF' => array('_REQUEST_ACCESS_TIME' => $this->storage->getRequestAccessTime(), 'foo' => 'bar'), 'foo' => 'bar', 'bar' => 'baz'); $this->assertSame($expected, $this->storage->toArray(true)); }
public function testClearWithArgumentRemovesExistingMetadataForThatKeyOnly() { $this->storage->foo = 'bar'; $this->storage->bar = 'baz'; $this->storage->lock('foo'); $this->storage->lock('bar'); $this->storage->setMetadata('foo', 'bar'); $this->storage->setMetadata('bar', 'baz'); $this->storage->clear('foo'); $this->assertFalse($this->storage->isLocked('foo')); $this->assertTrue($this->storage->isLocked('bar')); $this->assertFalse($this->storage->getMetadata('foo')); $this->assertEquals('baz', $this->storage->getMetadata('bar')); }