SettingsTest.php in System Status 8.2
File
tests/src/Functional/SettingsTest.php
View source
<?php
namespace Drupal\Tests\system_status\Functional;
use Drupal\Tests\BrowserTestBase;
class SettingsTest extends BrowserTestBase {
public static $modules = [
'system_status',
];
public function testSettings() {
$this
->drupalGet('/admin/config/system/system-status');
$this
->assertSession()
->statusCodeEquals(403);
$account = $this
->createUser([
'administer site configuration',
]);
$this
->drupalLogin($account);
$this
->drupalGet('/admin/config/system/system-status');
$this
->assertSession()
->statusCodeEquals(200);
$key = $this
->getSession()
->getPage()
->find('css', 'input[name="system_status_service"]');
$this
->assertNotEmpty($key);
}
}