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. 10 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()

Test createCollection.

File

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

Class

NullStorageTest
Tests the NullStorage.

Namespace

Drupal\Tests\Core\Config

Code

public function testCollection() {
    $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->assertArrayEquals([], $collection->getAllCollectionNames());
}

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