You are here

public function StorageTestBase::_testRename in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/service_container/Tests/KeyValue/StorageTestBase.php \Drupal\service_container\Tests\KeyValue\StorageTestBase::_testRename()

Tests the rename operation.

1 call to StorageTestBase::_testRename()
StorageTestBase::testKeyValueStore in lib/Drupal/service_container/Tests/KeyValue/StorageTestBase.php

File

lib/Drupal/service_container/Tests/KeyValue/StorageTestBase.php, line 250
Contains Drupal\service_container\Tests\KeyValue\StorageTestBase.

Class

StorageTestBase
Base class for testing key-value storages.

Namespace

Drupal\service_container\Tests\KeyValue

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'));
}