SimpleRecaptchaWebformTestBase.php in Simple Google reCAPTCHA 8
File
modules/simple_recaptcha_webform/tests/src/Functional/SimpleRecaptchaWebformTestBase.php
View source
<?php
namespace Drupal\Tests\simple_recaptcha_webform\Functional;
use Drupal\Tests\BrowserTestBase;
class SimpleRecaptchaWebformTestBase extends BrowserTestBase {
protected static $modules = [
'simple_recaptcha',
'webform',
'webform_ui',
'simple_recaptcha_webform',
'simple_recaptcha_webform_test',
];
protected $defaultTheme = 'bartik';
protected $user;
public function setUp() {
parent::setUp();
$this->user = $this
->drupalCreateUser([
'administer site configuration',
'administer simple_recaptcha',
'access any webform configuration',
'administer webform',
], 'webadmin');
}
public function testWebformAdminPage() {
$this
->drupalLogin($this->user);
$this
->drupalGet('/admin/structure/webform');
$this
->assertSession()
->statusCodeEquals(200);
$this
->drupalLogout();
}
}