function ExtensionInstallStorageTest::testCreateCollection

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php \Drupal\Tests\Core\Config\ExtensionInstallStorageTest::testCreateCollection()
  2. 10 core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php \Drupal\Tests\Core\Config\ExtensionInstallStorageTest::testCreateCollection()

@covers ::createCollection

File

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

Class

ExtensionInstallStorageTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21ExtensionInstallStorage.php/class/ExtensionInstallStorage/11.x" title="Storage to access configuration and schema in enabled extensions." class="local">\Drupal\Core\Config\ExtensionInstallStorage</a> @group Config

Namespace

Drupal\Tests\Core\Config

Code

public function testCreateCollection() : void {
    $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());
}

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