AdminUserLanguageFormPermissionTest.php in Admin User Language 8
File
tests/src/Functional/AdminUserLanguageFormPermissionTest.php
View source
<?php
namespace Drupal\Tests\admin_user_language\Functional;
use Drupal\Tests\BrowserTestBase;
class AdminUserLanguageFormPermissionTest extends BrowserTestBase {
public static $modules = [
'user',
'admin_user_language',
];
public function testPermissionDenied() {
$admin_user = $this
->drupalCreateUser([
'access administration pages',
]);
$this
->drupalLogin($admin_user);
$output = $this
->drupalGet('admin/config/admin_user_language/settings');
$this
->assertContains('Access denied', $output);
}
public function testPermissionGranted() {
$admin_user = $this
->drupalCreateUser([
'access administration pages',
'administer admin interface language',
]);
$this
->drupalLogin($admin_user);
$string = $this
->drupalGet('admin/config/admin_user_language/settings');
$this
->assertNotContains('Access denied', $string);
}
}