3 namespace Drupal\Tests\system\Functional\Form;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests access control for form elements.
12 class ElementsAccessTest extends BrowserTestBase {
19 public static $modules = ['form_test'];
22 * Ensures that child values are still processed when #access = FALSE.
24 public function testAccessFalse() {
25 $this->drupalPostForm('form_test/vertical-tabs-access', NULL, t('Submit'));
26 $this->assertNoText(t('This checkbox inside a vertical tab does not have its default value.'));
27 $this->assertNoText(t('This textfield inside a vertical tab does not have its default value.'));
28 $this->assertNoText(t('This checkbox inside a fieldset does not have its default value.'));
29 $this->assertNoText(t('This checkbox inside a container does not have its default value.'));
30 $this->assertNoText(t('This checkbox inside a nested container does not have its default value.'));
31 $this->assertNoText(t('This checkbox inside a vertical tab whose fieldset access is allowed does not have its default value.'));
32 $this->assertText(t('The form submitted correctly.'));