PermissionTest.php in Create user permission 8
File
tests/src/FunctionalJavascript/PermissionTest.php
View source
<?php
namespace Drupal\Tests\create_user_permission\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
class PermissionTest extends JavascriptTestBase {
public static $modules = [
'create_user_permission',
];
public function testPermission() {
$create_user = $this
->drupalCreateUser([
'create users',
]);
$admin_user = $this
->drupalCreateUser([
'administer users',
]);
$this
->drupalLogin($admin_user);
$this
->drupalGet('admin/people/create');
$this
->assertSession()
->statusCodeEquals(403);
$this
->drupalLogout();
$this
->drupalLogin($create_user);
$this
->drupalGet('admin/people/create');
$this
->assertSession()
->statusCodeEquals(200);
}
}
Classes
Name |
Description |
PermissionTest |
Tests the JavaScript functionality of the Create user permission module. |