function AjaxCommandsUnitTest::testCloseModalDialogCommand

Tests that CloseModalDialogCommand objects can be constructed and rendered.

File

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

Class

AjaxCommandsUnitTest
Tests for all AJAX Commands.

Namespace

Drupal\system\Tests\Ajax

Code

function testCloseModalDialogCommand() {
  $command = new CloseModalDialogCommand();
  $expected = array(
    'command' => 'closeDialog',
    'selector' => '#drupal-modal',
  );
  $this
    ->assertEqual($command
    ->render(), $expected, 'CloseModalDialogCommand::render() returns a proper array.');
}