function FrameworkTest::testAJAXRender

Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php \Drupal\Tests\system\Functional\Ajax\FrameworkTest::testAJAXRender()
  2. 10 core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php \Drupal\Tests\system\Functional\Ajax\FrameworkTest::testAJAXRender()
  3. 11.x core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php \Drupal\Tests\system\Functional\Ajax\FrameworkTest::testAJAXRender()

Verifies the Ajax rendering of a command in the settings.

File

core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php, line 35

Class

FrameworkTest
Performs tests on AJAX framework functions.

Namespace

Drupal\Tests\system\Functional\Ajax

Code

public function testAJAXRender() {
    // Verify that settings command is generated if JavaScript settings exist.
    $commands = $this->drupalGetAjax('ajax-test/render');
    $expected = new SettingsCommand([
        'ajax' => 'test',
    ], TRUE);
    $this->assertCommand($commands, $expected->render(), 'JavaScript settings command is present.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.