ExtensionInstallStorageTest.php

Same filename and directory in other branches
  1. 10 core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php
  2. 9 core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php
  3. 8.9.x core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php

Namespace

Drupal\Tests\Core\Config

File

core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\Core\Config;

use Drupal\Core\Config\ExtensionInstallStorage;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\MemoryStorage;
use Drupal\Core\Config\StorageInterface;
use Drupal\Tests\UnitTestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;

/**
 * Tests Drupal\Core\Config\ExtensionInstallStorage.
 */
class ExtensionInstallStorageTest extends UnitTestCase {
  
  /**
   * Tests create collection.
   *
   * @legacy-covers ::createCollection
   */
  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());
  }

}

Classes

Title Deprecated Summary
ExtensionInstallStorageTest Tests Drupal\Core\Config\ExtensionInstallStorage.

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