You are here

function ElementsVerticalTabsTest::testJavaScriptOrdering in Zircon Profile 8

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

Ensures that vertical-tabs.js is included before collapse.js.

Otherwise, collapse.js adds "SHOW" or "HIDE" labels to the tabs.

File

core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php, line 55
Contains \Drupal\system\Tests\Form\ElementsVerticalTabsTest.

Class

ElementsVerticalTabsTest
Tests the vertical_tabs form element for expected behavior.

Namespace

Drupal\system\Tests\Form

Code

function testJavaScriptOrdering() {
  $this
    ->drupalGet('form_test/vertical-tabs');
  $position1 = strpos($this->content, 'core/misc/vertical-tabs.js');
  $position2 = strpos($this->content, 'core/misc/collapse.js');
  $this
    ->assertTrue($position1 !== FALSE && $position2 !== FALSE && $position1 < $position2, 'vertical-tabs.js is included before collapse.js');
}