public function StorageTestBase::testRename in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php \Drupal\KernelTests\Core\KeyValueStore\StorageTestBase::testRename()
Tests the rename operation.
File
- core/tests/ Drupal/ KernelTests/ Core/ KeyValueStore/ StorageTestBase.php, line 183 
Class
- StorageTestBase
- Base class for testing key-value storages.
Namespace
Drupal\KernelTests\Core\KeyValueStoreCode
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'));
}