public function RoleBasedPathTest::testReachableRulePage in Role Based Theme Switcher 8
Same name and namespace in other branches
- 9.1.x tests/src/Functional/RoleBasedPathTest.php \Drupal\Tests\role_based_theme_switcher\Functional\RoleBasedPathTest::testReachableRulePage()
Tests that the Role Based UI pages are reachable.
@group role_based_theme_switcher
File
- tests/
src/ Functional/ RoleBasedPathTest.php, line 38
Class
- RoleBasedPathTest
- Description of RoleBasedPathTest
Namespace
Drupal\Tests\role_based_theme_switcher\FunctionalCode
public function testReachableRulePage() {
$values = [
'edit-role-theme-authenticated-id' => 'stable',
];
$account = $this
->drupalCreateUser([
'administer site configuration',
]);
$this
->drupalLogin($account);
$this
->drupalGet('/admin/structure/role_based_theme_switcher/settings');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('Role Based Theme Setting');
$this
->submitForm($values, 'Save configuration', 'role-admin-settings');
$xpath = "//div[@class='messages messages--status']";
$this
->xpath($xpath);
}