You are here

public function ExtensionInstallStorageTest::testCreateCollection in Drupal 9

@covers ::createCollection

File

core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php, line 20

Class

ExtensionInstallStorageTest
@coversDefaultClass \Drupal\Core\Config\ExtensionInstallStorage @group Config

Namespace

Drupal\Tests\Core\Config

Code

public function testCreateCollection() {
  $memory = new MemoryStorage();
  $include_profile = FALSE;
  $profile = $this
    ->randomMachineName();
  $collectionName = $this
    ->randomMachineName();

  // Set up the storage.
  $storage = new ExtensionInstallStorage($memory, InstallStorage::CONFIG_INSTALL_DIRECTORY, StorageInterface::DEFAULT_COLLECTION, $include_profile, $profile);

  // Create a collection.
  $collection = $storage
    ->createCollection($collectionName);
  static::assertEquals($collectionName, $collection
    ->getCollectionName());
}