Esempio n. 1
0
 public function testGetMetadatas()
 {
     $items = array('key1' => 'value1', 'key2' => 'value2');
     $this->assertTrue($this->_storage->setItems($items));
     $metadatas = $this->_storage->getMetadatas(array_keys($items));
     $this->assertInternalType('array', $metadatas);
     $this->assertSame(count($items), count($metadatas));
     foreach ($metadatas as $k => $info) {
         $this->assertTrue(isset($items[$k]));
         $this->assertInternalType('array', $info);
     }
 }
Esempio n. 2
0
 public function testGetMetadatas()
 {
     $capabilities = $this->_storage->getCapabilities();
     if (!$capabilities->getSupportedMetadata()) {
         $this->markTestSkipped("Metadata are not supported by the adapter");
     }
     $items = array('key1' => 'value1', 'key2' => 'value2');
     $this->assertTrue($this->_storage->setItems($items));
     $metadatas = $this->_storage->getMetadatas(array_keys($items));
     $this->assertInternalType('array', $metadatas);
     $this->assertSame(count($items), count($metadatas));
     foreach ($metadatas as $k => $info) {
         $this->assertTrue(isset($items[$k]));
         $this->assertInternalType('array', $info);
     }
 }
Esempio n. 3
0
 public function testGetMetadatasReturnsEmptyArrayIfNonReadable()
 {
     $this->_options->setReadable(false);
     $this->assertTrue($this->_storage->setItem('key', 'value'));
     $this->assertEquals(array(), $this->_storage->getMetadatas(array('key')));
 }