Skip to content
Snippets Groups Projects

Resolve #2910445 "Add a warning"

2 files
+ 56
0
Compare changes
  • Side-by-side
  • Inline

Files

@@ -141,4 +141,24 @@ class ReadOnlyConfigTest extends ReadOnlyConfigTestBase {
@@ -141,4 +141,24 @@ class ReadOnlyConfigTest extends ReadOnlyConfigTestBase {
$this->assertSession()->pageTextContains($this->message);
$this->assertSession()->pageTextContains($this->message);
}
}
 
/**
 
* Test the status page to ensure the correct message is displayed.
 
*
 
* @see https://www.drupal.org/project/config_readonly/issues/2910445
 
*/
 
public function testModuleStatusPage() {
 
// Verify if we can successfully access file system route.
 
$status_url = Url::fromRoute('system.status');
 
$this->drupalGet($status_url);
 
$this->assertSession()->statusCodeEquals(200);
 
// Status page displays REQUIREMENT_WARNING because read-only is disabled.
 
$this->assertSession()->pageTextContains("The Config Read-only module is enabled but not active.");
 
 
// Switch forms to read-only.
 
$this->turnOnReadOnlySetting();
 
$this->drupalGet($status_url);
 
// Status page displays REQUIREMENT_INFO because read-only is enabled.
 
$this->assertSession()->pageTextContains("The Config Read-only module is enabled and active.");
 
}
 
}
}
Loading