Ejemplo n.º 1
0
 public function testGetItems()
 {
     $keys = ["empty2", "empty3"];
     $items = $this->fp->getItems($keys);
     $this->assertTrue(is_array($items));
     foreach ($keys as $key) {
         $this->assertArrayHasKey($key, $items);
         $this->checkItem($items[$key], $key);
     }
 }
Ejemplo n.º 2
0
 public function testFromFile()
 {
     $map = FilePool::mapKey("test");
     $testItem = FileItem::fromFile('/tmp/' . $map['dir'] . '/' . $map['file'], "test");
     $this->assertInstanceOf('\\Perry\\Cache\\File\\FileItem', $testItem);
     $this->assertTrue($testItem->isHit());
     $this->assertTrue($testItem->exists());
     $this->assertEquals("testval", $testItem->get());
     $this->assertEquals($this->item->getKey(), $testItem->getKey());
 }