You are here

public function FormTestBase::testFormBuilds in Purge 8.3

Assert that basic form building succeeds without issues.

File

modules/purge_ui/tests/src/Functional/Form/FormTestBase.php, line 230

Class

FormTestBase
Testbase for purge_ui forms.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

public function testFormBuilds() : void {
  $this
    ->drupalLogin($this->adminUser);
  $form = $this
    ->getBuiltForm();
  $this
    ->assertSame(TRUE, isset($form['#type']));
  $this
    ->assertSame(TRUE, isset($form['form_id']['#value']));
  $this
    ->assertSame(TRUE, isset($form['#form_id']));
  $this
    ->assertSame(TRUE, isset($form['#cache']['contexts'][0]));
  $this
    ->assertSame('form', $form['#type']);
  $this
    ->assertSame($this->formId, $form['form_id']['#value']);
  $this
    ->assertSame($this->formId, $form['#form_id']);
  $this
    ->assertSame([
    'user.roles:authenticated',
  ], $form['#cache']['contexts']);
}