You are here

public function BackendGeneralTestCase::checkVariable in Supercache 8

Same name and namespace in other branches
  1. 2.0.x src/Tests/Generic/Cache/BackendGeneralTestCase.php \Drupal\supercache\Tests\Generic\Cache\BackendGeneralTestCase::checkVariable()

Check or a variable is stored and restored properly.

4 calls to BackendGeneralTestCase::checkVariable()
BackendSavingTests::testArray in src/Tests/Generic/Cache/BackendSavingTests.php
Test the saving and restoring of an array.
BackendSavingTests::testDouble in src/Tests/Generic/Cache/BackendSavingTests.php
Test the saving and restoring of a double.
BackendSavingTests::testInteger in src/Tests/Generic/Cache/BackendSavingTests.php
Test the saving and restoring of an integer.
BackendSavingTests::testString in src/Tests/Generic/Cache/BackendSavingTests.php
Test the saving and restoring of a string.

File

src/Tests/Generic/Cache/BackendGeneralTestCase.php, line 59

Class

BackendGeneralTestCase
Testea funciones basicas.

Namespace

Drupal\supercache\Tests\Generic\Cache

Code

public function checkVariable($var) {
  $this->backend
    ->set('test_var', $var, CacheBackendInterface::CACHE_PERMANENT);
  $cache = $this->backend
    ->get('test_var');
  $this
    ->assertTrue(isset($cache->data) && $cache->data === $var, (new FormattableMarkup('@type is saved and restored properly.', array(
    '@type' => Unicode::ucfirst(gettype($var)),
  )))
    ->__toString());
}