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); } }
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()); }