public function SiteConfigOverridesTest::testSiteOverride in Config override 8
File
- tests/
Unit/ SiteConfigOverridesTest.php, line 17
Class
- SiteConfigOverridesTest
- @coversDefaultClass \Drupal\config_override\SiteConfigOverrides @group config_override
Namespace
Drupal\config_override\Tests\UnitCode
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);
}