NullStorageTest.php 737 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Drupal\Tests\Core\Config;
  3. use Drupal\Core\Config\NullStorage;
  4. use Drupal\Core\Config\StorageInterface;
  5. use Drupal\Tests\UnitTestCase;
  6. /**
  7. * Tests the NullStorage.
  8. *
  9. * @group Config
  10. */
  11. class NullStorageTest extends UnitTestCase {
  12. /**
  13. * Test createCollection.
  14. */
  15. public function testCollection() {
  16. $nullStorage = new NullStorage();
  17. $collection = $nullStorage->createCollection('test');
  18. $this->assertInstanceOf(StorageInterface::class, $collection);
  19. $this->assertEquals(StorageInterface::DEFAULT_COLLECTION, $nullStorage->getCollectionName());
  20. $this->assertEquals('test', $collection->getCollectionName());
  21. $this->assertArrayEquals([], $collection->getAllCollectionNames());
  22. }
  23. }