You are here

public function AjaxPageStateTest::testMultipleLibrariesAreNotLoaded in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Render/AjaxPageStateTest.php \Drupal\system\Tests\Render\AjaxPageStateTest::testMultipleLibrariesAreNotLoaded()

Test if multiple libaries can be excluded.

ajax_page_state[libraries] should be able to support multiple libraries comma separated.

File

core/modules/system/src/Tests/Render/AjaxPageStateTest.php, line 92
Contains \Drupal\system\Tests\Render\AjaxPageStateTest.

Class

AjaxPageStateTest
Performs tests for the effects of the ajax_page_state query parameter.

Namespace

Drupal\system\Tests\Render

Code

public function testMultipleLibrariesAreNotLoaded() {
  $this
    ->drupalGet('node', array(
    "query" => array(
      'ajax_page_state' => array(
        'libraries' => 'core/html5shiv,core/drupalSettings',
      ),
    ),
  ));
  $this
    ->assertNoRaw('/core/assets/vendor/html5shiv/html5shiv.min.js', 'The html5shiv library from core should be excluded from loading.');
  $this
    ->assertNoRaw('/core/misc/drupalSettingsLoader.js', 'The Dupalsettings library from core should be excluded from loading.');
}