You are here

public function VueFormTest::testBuildForm in Decoupled Blocks: Vue.js 8

Tests the buildForm() method.

File

tests/src/Unit/Form/VueFormTest.php, line 76

Class

VueFormTest
@coversDefaultClass \Drupal\pdb_vue\Form\VueForm @group pdb_vue

Namespace

Drupal\Tests\pdb_vue\Unit\Form

Code

public function testBuildForm() {
  $form = [];
  $result = $this->form
    ->buildForm($form, $this->formState);
  $this
    ->assertEquals('system_config_form', $result['#theme']);
  $this
    ->assertEquals('vue2', $result['version']['#default_value']);
  $this
    ->assertEquals('0', $result['development_mode']['#default_value']);
  $this
    ->assertEquals('0', $result['use_spa']['#default_value']);
  $this
    ->assertEquals('#element', $result['spa_element']['#default_value']);
}