ReadOnlyConfigWhitelistTest.php in Configuration Read-only mode 8
File
tests/src/Functional/ReadOnlyConfigWhitelistTest.php
View source
<?php
namespace Drupal\Tests\config_readonly\Functional;
class ReadOnlyConfigWhitelistTest extends ReadOnlyConfigTest {
public static $modules = [
'config',
'config_readonly',
'node',
'config_readonly_whitelist_test',
];
protected $defaultTheme = 'stark';
public function testWhitelist() {
$assert_session = $this
->assertSession();
$this
->createContentType([
'type' => 'article1',
'name' => 'Article1',
]);
$this
->createContentType([
'type' => 'article2',
'name' => 'Article2',
]);
$this
->turnOnReadOnlySetting();
$this
->drupalGet('admin/structure/types/manage/article1');
$assert_session
->pageTextContains('This form will not be saved because the configuration active store is read-only.');
$this
->drupalGet('admin/structure/types/manage/article2');
$assert_session
->pageTextNotContains('This form will not be saved because the configuration active store is read-only.');
}
public function testSimpleConfig() {
$assert_session = $this
->assertSession();
$this
->drupalGet('admin/config/development/configuration/single/import');
$assert_session
->pageTextNotContains('This form will not be saved because the configuration active store is read-only.');
$this
->drupalGet('admin/config/development/performance');
$assert_session
->pageTextNotContains('This form will not be saved because the configuration active store is read-only.');
$this
->turnOnReadOnlySetting();
$this
->drupalGet('admin/config/development/configuration/single/import');
$assert_session
->pageTextContains('This form will not be saved because the configuration active store is read-only.');
$this
->drupalGet('admin/config/development/performance');
$assert_session
->pageTextNotContains('This form will not be saved because the configuration active store is read-only.');
}
}