class ElementsAccessTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php \Drupal\Tests\system\Functional\Form\ElementsAccessTest
- 10 core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php \Drupal\Tests\system\Functional\Form\ElementsAccessTest
- 8.9.x core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php \Drupal\Tests\system\Functional\Form\ElementsAccessTest
Tests access control for form elements.
@group Form
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Form\ElementsAccessTest implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of ElementsAccessTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Form/ ElementsAccessTest.php, line 12
Namespace
Drupal\Tests\system\Functional\FormView source
class ElementsAccessTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'form_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Ensures that child values are still processed when #access = FALSE.
*/
public function testAccessFalse() {
$this->drupalGet('form_test/vertical-tabs-access');
$this->submitForm([], 'Submit');
$this->assertSession()
->pageTextNotContains('This checkbox inside a vertical tab does not have its default value.');
$this->assertSession()
->pageTextNotContains('This textfield inside a vertical tab does not have its default value.');
$this->assertSession()
->pageTextNotContains('This checkbox inside a fieldset does not have its default value.');
$this->assertSession()
->pageTextNotContains('This checkbox inside a container does not have its default value.');
$this->assertSession()
->pageTextNotContains('This checkbox inside a nested container does not have its default value.');
$this->assertSession()
->pageTextNotContains('This checkbox inside a vertical tab whose fieldset access is allowed does not have its default value.');
$this->assertSession()
->pageTextContains('The form submitted correctly.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.