You are here

public function ConfigSnapshotStorageTest::testCreateCollection in Config Snapshot 8

Tests if new collections created correctly.

@dataProvider providerCollections

Parameters

string $collection: The collection name.

File

tests/src/Kernel/ConfigSnapshotStorageTest.php, line 109

Class

ConfigSnapshotStorageTest
Tests ConfigSnapshotStorage operations.

Namespace

Drupal\Tests\config_snapshot\Kernel

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