function NullStorageTest::testCollection

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/NullStorageTest.php \Drupal\Tests\Core\Config\NullStorageTest::testCollection()
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/NullStorageTest.php \Drupal\Tests\Core\Config\NullStorageTest::testCollection()
  3. 11.x core/tests/Drupal/Tests/Core/Config/NullStorageTest.php \Drupal\Tests\Core\Config\NullStorageTest::testCollection()

Tests createCollection.

File

core/tests/Drupal/Tests/Core/Config/NullStorageTest.php, line 21

Class

NullStorageTest
Tests the NullStorage.

Namespace

Drupal\Tests\Core\Config

Code

public function testCollection() : void {
    $nullStorage = new NullStorage();
    $collection = $nullStorage->createCollection('test');
    $this->assertInstanceOf(StorageInterface::class, $collection);
    $this->assertEquals(StorageInterface::DEFAULT_COLLECTION, $nullStorage->getCollectionName());
    $this->assertEquals('test', $collection->getCollectionName());
    $this->assertSame([], $collection->getAllCollectionNames());
}

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