NullStorageTest.php

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

Namespace

Drupal\Tests\Core\Config

File

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

View source
<?php

namespace Drupal\Tests\Core\Config;

use Drupal\Core\Config\NullStorage;
use Drupal\Core\Config\StorageInterface;
use Drupal\Tests\UnitTestCase;

/**
 * Tests the NullStorage.
 *
 * @group Config
 */
class NullStorageTest extends UnitTestCase {
    
    /**
     * Tests createCollection.
     */
    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->assertSame([], $collection->getAllCollectionNames());
    }

}

Classes

Title Deprecated Summary
NullStorageTest Tests the NullStorage.

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