public function PhpFileCacheTest::testImplementsSetState in Plug 7
File
- lib/
doctrine/ cache/ tests/ Doctrine/ Tests/ Common/ Cache/ PhpFileCacheTest.php, line 46
Class
- PhpFileCacheTest
- @group DCOM-101
Namespace
Doctrine\Tests\Common\CacheCode
public function testImplementsSetState() {
$cache = $this
->_getCacheDriver();
// Test save
$cache
->save('test_set_state', new SetStateClass(array(
1,
2,
3,
)));
//Test __set_state call
$this
->assertCount(0, SetStateClass::$values);
// Test fetch
$value = $cache
->fetch('test_set_state');
$this
->assertInstanceOf('Doctrine\\Tests\\Common\\Cache\\SetStateClass', $value);
$this
->assertEquals(array(
1,
2,
3,
), $value
->getValue());
//Test __set_state call
$this
->assertCount(1, SetStateClass::$values);
// Test contains
$this
->assertTrue($cache
->contains('test_set_state'));
}