function StorageTestBase::testRenameNoChange

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php \Drupal\KernelTests\Core\KeyValueStore\StorageTestBase::testRenameNoChange()
  2. 11.x core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php \Drupal\KernelTests\Core\KeyValueStore\StorageTestBase::testRenameNoChange()

Tests the rename operation.

File

core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php, line 200

Class

StorageTestBase
Base class for testing key-value storages.

Namespace

Drupal\KernelTests\Core\KeyValueStore

Code

public function testRenameNoChange() : void {
    $stores = $this->createStorage();
    $store = $stores[0];
    $store->set('old', 'thing');
    $this->assertSame($store->get('old'), 'thing');
    $store->rename('old', 'old');
    $this->assertSame($store->get('old'), 'thing');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.