function AjaxCommandsUnitTest::testChangedCommand

Tests that ChangedCommand objects can be constructed and rendered.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxCommandsUnitTest.php, line 126
Definition of Drupal\system\Tests\Ajax\AjaxCommandsUnitTest.

Class

AjaxCommandsUnitTest
Tests for all AJAX Commands.

Namespace

Drupal\system\Tests\Ajax

Code

function testChangedCommand() {
  $command = new ChangedCommand('#page-title', '#page-title-changed');
  $expected = array(
    'command' => 'changed',
    'selector' => '#page-title',
    'asterisk' => '#page-title-changed',
  );
  $this
    ->assertEqual($command
    ->render(), $expected, 'ChangedCommand::render() returns a proper array.');
}