예제 #1
0
 public function testGetMetadatas()
 {
     $options = array('ttl' => 123);
     $items = array('key1' => array('meta1' => 1), 'dKey1' => false, 'key2' => array('meta2' => 2));
     $i = 0;
     foreach ($items as $k => $v) {
         $this->_storage->expects($this->at($i++))->method('getMetadata')->with($this->equalTo($k), $this->equalTo($options))->will($this->returnValue($v));
     }
     $rs = $this->_storage->getMetadatas(array_keys($items), $options);
     // remove missing items from array to test
     $expected = $items;
     foreach ($expected as $key => $value) {
         if (false === $value) {
             unset($expected[$key]);
         }
     }
     $this->assertEquals($expected, $rs);
 }