You are here

public function FrameworkTest::testCurrentPathChange in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Ajax/FrameworkTest.php \Drupal\system\Tests\Ajax\FrameworkTest::testCurrentPathChange()

Tests that drupalSettings.currentPath is not updated on AJAX requests.

File

core/modules/system/src/Tests/Ajax/FrameworkTest.php, line 188
Contains \Drupal\system\Tests\Ajax\FrameworkTest.

Class

FrameworkTest
Performs tests on AJAX framework functions.

Namespace

Drupal\system\Tests\Ajax

Code

public function testCurrentPathChange() {
  $commands = $this
    ->drupalPostAjaxForm('ajax_forms_test_lazy_load_form', array(
    'add_files' => FALSE,
  ), array(
    'op' => t('Submit'),
  ));
  foreach ($commands as $command) {
    if ($command['command'] == 'settings') {
      $this
        ->assertFalse(isset($command['settings']['currentPath']), 'Value of drupalSettings.currentPath is not updated after an AJAX request.');
    }
  }
}