diff --git a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php index 0384148..3bf294c 100644 --- a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php +++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php @@ -329,6 +329,31 @@ public function testOpenDialogCommand() { } /** + * Tests that OpenDialogCommand objects title can be changed. + */ + public function testOpenDialogCommandSetTitle() { + $command = new OpenDialogCommand('#some-dialog', 'Title', '

Text!

', array( + 'url' => FALSE, + 'width' => 500, + )); + + $expected = array( + 'command' => 'openDialog', + 'selector' => '#some-dialog', + 'settings' => NULL, + 'data' => '

Text!

', + 'dialogOptions' => array( + 'url' => FALSE, + 'width' => 500, + 'title' => 'newTitle', + 'modal' => FALSE, + ), + ); + $command->setDialogTitle('newTitle'); + $this->assertEquals($command->render(), $expected, "OpenDialogCommand::render() didn't return the expected array."); + } + + /** * Tests that OpenModalDialogCommand objects can be constructed and rendered. */ public function testOpenModalDialogCommand() {