ConfigExportStorageTest.php in Drupal 10
File
core/tests/Drupal/KernelTests/Core/Config/ConfigExportStorageTest.php
View source
<?php
namespace Drupal\KernelTests\Core\Config;
use Drupal\KernelTests\KernelTestBase;
class ConfigExportStorageTest extends KernelTestBase {
protected static $modules = [
'system',
'config_test',
];
protected function setUp() : void {
parent::setUp();
$this
->installConfig([
'system',
'config_test',
]);
}
public function testExportStorage() {
$active = $this->container
->get('config.storage');
$export = $this->container
->get('config.storage.export');
$this
->assertNotEmpty($active
->listAll());
$this
->assertEquals($active
->listAll(), $export
->listAll());
foreach ($active
->listAll() as $name) {
$this
->assertEquals($active
->read($name), $export
->read($name));
}
$this
->expectException(\BadMethodCallException::class);
$export
->deleteAll();
}
}