public function GenericCacheBackendUnitTestBase::testIsEmpty

Tests Drupal\Core\Cache\CacheBackendInterface::isEmpty().

File

drupal/core/modules/system/lib/Drupal/system/Tests/Cache/GenericCacheBackendUnitTestBase.php, line 304
Definition of Drupal\system\Tests\Cache\GenericCacheBackendUnitTestBase.

Class

GenericCacheBackendUnitTestBase
Tests any cache backend.

Namespace

Drupal\system\Tests\Cache

Code

public function testIsEmpty() {
  $backend = $this
    ->getCacheBackend();
  $this
    ->assertTrue($backend
    ->isEmpty(), "Backend is empty.");
  $backend
    ->set('pony', "Shetland");
  $this
    ->assertFalse($backend
    ->isEmpty(), "Backend is not empty.");
  $backend
    ->delete('pony');
  $this
    ->assertTrue($backend
    ->isEmpty(), "Backend is empty.");
}