コード例 #1
0
ファイル: DriverTest.php プロジェクト: savritsky/cache
 public function testListOperations()
 {
     $list = 'testlist';
     // empty list
     $this->assertEquals([], $this->driver->getList($list), '->getList() should return an empty array when the list does not exist yet');
     // add items to list
     $this->assertTrue($this->driver->addToList($list, 'foo'), '->addToList() should return true on success');
     $this->assertTrue($this->driver->addToList($list, 'bar'), '->addToList() should return true on success');
     $items = $this->driver->getList($list);
     // items should be in list
     $this->assertContains('foo', $items);
     $this->assertContains('bar', $items);
     // remove item from list
     $this->assertTrue($this->driver->removeFromList($list, 'foo'), '->removeFromList() should return true on success');
     $items = $this->driver->getList($list);
     // foo should be removed, but bar not
     $this->assertNotContains('foo', $items);
     $this->assertContains('bar', $items);
 }
コード例 #2
0
ファイル: Cache.php プロジェクト: savritsky/cache
 /**
  * @inheritdoc
  */
 public function addToList($list, $value)
 {
     return $this->driver->addToList($list, $value);
 }