function AjaxCommandsUnitTest::testCloseDialogCommand

Tests that CloseDialogCommand objects can be constructed and rendered.

File

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

Class

AjaxCommandsUnitTest
Tests for all AJAX Commands.

Namespace

Drupal\system\Tests\Ajax

Code

function testCloseDialogCommand() {
  $command = new CloseDialogCommand('#some-dialog');
  $expected = array(
    'command' => 'closeDialog',
    'selector' => '#some-dialog',
  );
  $this
    ->assertEqual($command
    ->render(), $expected, 'CloseDialogCommand::render() with a selector returns a proper array.');
}