drupalGetAjax example

/** * {@inheritdoc} */
  protected static $modules = ['node', 'ajax_test', 'ajax_forms_test'];

  /** * Verifies the Ajax rendering of a command in the settings. */
  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());
  }

  /** * Tests AjaxResponse::prepare() AJAX commands ordering. */
  public function testOrder() {
    $expected_commands = [];

    // Expected commands, in a very specific order.
Home | Imprint | This part of the site doesn't use cookies.