You are here

class SiteConfigOverridesTest in Config override 8

@coversDefaultClass \Drupal\config_override\SiteConfigOverrides @group config_override

Hierarchy

Expanded class hierarchy of SiteConfigOverridesTest

File

tests/Unit/SiteConfigOverridesTest.php, line 15

Namespace

Drupal\config_override\Tests\Unit
View source
class SiteConfigOverridesTest extends TestCase {
  public function testSiteOverride() {
    $cache_backend = $this
      ->prophesize(CacheBackendInterface::class);
    $site_override = new SiteConfigOverrides('vfs://drupal', $cache_backend
      ->reveal());
    vfsStream::setup('drupal');
    vfsStream::create([
      'sites' => [
        'default' => [
          'config' => [
            'override' => [
              'system.site.yml' => Yaml::encode([
                'name' => 'Hey jude',
              ]),
            ],
          ],
        ],
      ],
    ]);
    $result = $site_override
      ->loadOverrides([
      'system.site',
    ]);
    $this
      ->assertEquals([
      'system.site' => [
        'name' => 'Hey jude',
      ],
    ], $result);
  }

}

Members