You are here

public function ElementsAccessTest::testAccessFalse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Form/ElementsAccessTest.php \Drupal\system\Tests\Form\ElementsAccessTest::testAccessFalse()

Ensures that child values are still processed when #access = FALSE.

File

core/modules/system/src/Tests/Form/ElementsAccessTest.php, line 29
Contains \Drupal\system\Tests\Form\ElementsAccessTest.

Class

ElementsAccessTest
Tests access control for form elements.

Namespace

Drupal\system\Tests\Form

Code

public function testAccessFalse() {
  $this
    ->drupalPostForm('form_test/vertical-tabs-access', NULL, t('Submit'));
  $this
    ->assertNoText(t('This checkbox inside a vertical tab does not have its default value.'));
  $this
    ->assertNoText(t('This textfield inside a vertical tab does not have its default value.'));
  $this
    ->assertNoText(t('This checkbox inside a fieldset does not have its default value.'));
  $this
    ->assertNoText(t('This checkbox inside a container does not have its default value.'));
  $this
    ->assertNoText(t('This checkbox inside a nested container does not have its default value.'));
  $this
    ->assertNoText(t('This checkbox inside a vertical tab whose fieldset access is allowed does not have its default value.'));
  $this
    ->assertText(t('The form submitted correctly.'));
}