function StorageReplaceDataWrapperTest::testCreateCollection

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php \Drupal\KernelTests\Core\Config\Storage\StorageReplaceDataWrapperTest::testCreateCollection()
  2. 10 core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php \Drupal\KernelTests\Core\Config\Storage\StorageReplaceDataWrapperTest::testCreateCollection()
  3. 11.x core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php \Drupal\KernelTests\Core\Config\Storage\StorageReplaceDataWrapperTest::testCreateCollection()

Tests if new collections created correctly.

@dataProvider providerCollections

Parameters

string $collection: The collection name.

File

core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php, line 69

Class

StorageReplaceDataWrapperTest
Tests StorageReplaceDataWrapper operations.

Namespace

Drupal\KernelTests\Core\Config\Storage

Code

public function testCreateCollection($collection) {
    $initial_collection_name = $this->storage
        ->getCollectionName();
    // Create new storage with given collection and check it is set correctly.
    $new_storage = $this->storage
        ->createCollection($collection);
    $this->assertSame($collection, $new_storage->getCollectionName());
    // Check collection not changed in the current storage instance.
    $this->assertSame($initial_collection_name, $this->storage
        ->getCollectionName());
}

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