You are here

public function PhpFileCacheTest::testImplementsSetState in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php \Doctrine\Tests\Common\Cache\PhpFileCacheTest::testImplementsSetState()

File

vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php, line 46

Class

PhpFileCacheTest
@group DCOM-101

Namespace

Doctrine\Tests\Common\Cache

Code

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