LoginSecurityInterfaceTest.php in Login Security 8
File
src/Tests/LoginSecurityInterfaceTest.php
View source
<?php
namespace Drupal\login_security\Tests;
use Drupal\Component\Utility\SafeMarkup;
class LoginSecurityInterfaceTest extends LoginSecurityTestBase {
public static $modules = [
'user',
'login_security',
];
public function setUp() {
parent::setUp();
$admin_user = $this
->drupalCreateUser([
'administer site configuration',
]);
$this
->drupalLogin($admin_user);
}
public function testAdminUserSettings() {
$settings_fields = $this
->getAdminUserSettingsFields();
$this
->drupalGet(parent::ADMIN_SETTINGS_PATH);
$this
->assertResponse(200, 'Access granted to settings page.');
foreach ($settings_fields as $field_name) {
$this
->assertField($field_name, SafeMarkup::format('@field_name field exists.', [
'@field_name' => $field_name,
]));
}
}
}