RoleBasedPathTest.php in Role Based Theme Switcher 9.1.x
File
tests/src/Functional/RoleBasedPathTest.php
View source
<?php
namespace Drupal\Tests\role_based_theme_switcher\Functional;
use Drupal\Tests\BrowserTestBase;
class RoleBasedPathTest extends BrowserTestBase {
protected static $modules = [
'role_based_theme_switcher',
];
public function setUp() {
parent::setUp();
}
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);
}
}