You are here

public function StorageTestBase::testRename in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/KeyValueStore/StorageTestBase.php \Drupal\system\Tests\KeyValueStore\StorageTestBase::testRename()

Tests the rename operation.

File

core/modules/system/src/Tests/KeyValueStore/StorageTestBase.php, line 188
Contains \Drupal\system\Tests\KeyValueStore\StorageTestBase.

Class

StorageTestBase
Base class for testing key-value storages.

Namespace

Drupal\system\Tests\KeyValueStore

Code

public function testRename() {
  $stores = $this
    ->createStorage();
  $store = $stores[0];
  $store
    ->set('old', 'thing');
  $this
    ->assertIdentical($store
    ->get('old'), 'thing');
  $store
    ->rename('old', 'new');
  $this
    ->assertIdentical($store
    ->get('new'), 'thing');
  $this
    ->assertNull($store
    ->get('old'));
}