You are here

private function MergeTermsTest::getEmptyFormExpectation in Term Merge 8

Returns the expected form structure when the form is empty.

Return value

array A renderable array.

2 calls to MergeTermsTest::getEmptyFormExpectation()
MergeTermsTest::vocabularyWithoutTermsReturnsEmptyForm in tests/src/Kernel/Form/MergeTermsTest.php
Tests a term merge form for a vocabulary without terms.
MergeTermsTest::vocabularyWithTerms in tests/src/Kernel/Form/MergeTermsTest.php
Tests a term merge form for a vocabulary with terms.

File

tests/src/Kernel/Form/MergeTermsTest.php, line 170

Class

MergeTermsTest
Tests the term merge form.

Namespace

Drupal\Tests\term_merge\Kernel\Form

Code

private function getEmptyFormExpectation() {
  return [
    'terms' => [
      '#type' => 'select',
      '#title' => new TranslatableMarkup("Terms to merge"),
      '#options' => [],
      '#empty_option' => new TranslatableMarkup('Select two or more terms to merge together'),
      '#multiple' => TRUE,
      '#required' => TRUE,
    ],
    'actions' => [
      '#type' => 'actions',
      'submit' => [
        '#button_type' => 'primary',
        '#type' => 'submit',
        '#value' => new TranslatableMarkup('Merge'),
      ],
    ],
  ];
}