You are here

public function ReadOnlyConfigTest::testSimpleConfig in Configuration Read-only mode 8

Tests switching a simple config form to read-only.

1 method overrides ReadOnlyConfigTest::testSimpleConfig()
ReadOnlyConfigWhitelistTest::testSimpleConfig in tests/src/Functional/ReadOnlyConfigWhitelistTest.php
Test simple config with whitelist.

File

tests/src/Functional/ReadOnlyConfigTest.php, line 132

Class

ReadOnlyConfigTest
Tests read-only module config functionality.

Namespace

Drupal\Tests\config_readonly\Functional

Code

public function testSimpleConfig() {

  // Verify if we can successfully access the site information route.
  $site_url = Url::fromRoute('system.site_information_settings');
  $this
    ->drupalGet($site_url);
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // The site information form is not read-only.
  $this
    ->assertSession()
    ->pageTextNotContains($this->message);

  // Switch forms to read-only.
  $this
    ->turnOnReadOnlySetting();
  $this
    ->drupalGet($site_url);

  // The site information form is read-only.
  $this
    ->assertSession()
    ->pageTextContains($this->message);
}