SystemConfigFormTest.php in Drupal 9
File
core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\Form;
use Drupal\Tests\BrowserTestBase;
class SystemConfigFormTest extends BrowserTestBase {
protected static $modules = [
'form_test',
];
protected $defaultTheme = 'stark';
public function testSystemConfigForm() {
$this
->drupalGet('form-test/system-config-form');
$this
->assertSession()
->elementExists('xpath', "//div[@id = 'edit-actions']/input[contains(@class, 'button--primary')]");
$this
->submitForm([], 'Save configuration');
$this
->assertSession()
->pageTextContains('The configuration options have been saved.');
}
}