Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / outside_in / tests / src / Unit / Ajax / OpenOffCanvasDialogCommandTest.php
1 <?php
2
3 namespace Drupal\Tests\outside_in\Unit\Ajax;
4
5 use Drupal\outside_in\Ajax\OpenOffCanvasDialogCommand;
6 use Drupal\Tests\UnitTestCase;
7
8 /**
9  * @coversDefaultClass \Drupal\outside_in\Ajax\OpenOffCanvasDialogCommand
10  * @group outside_in
11  */
12 class OpenOffCanvasDialogCommandTest extends UnitTestCase {
13
14   /**
15    * @covers ::render
16    */
17   public function testRender() {
18     $command = new OpenOffCanvasDialogCommand('Title', '<p>Text!</p>', ['url' => 'example']);
19
20     $expected = [
21       'command' => 'openDialog',
22       'selector' => '#drupal-off-canvas',
23       'settings' => NULL,
24       'data' => '<p>Text!</p>',
25       'dialogOptions' => [
26         'url' => 'example',
27         'title' => 'Title',
28         'modal' => FALSE,
29         'autoResize' => FALSE,
30         'resizable' => 'w',
31         'draggable' => FALSE,
32         'drupalAutoButtons' => FALSE,
33         'buttons' => [],
34         'width' => 300,
35       ],
36       'effect' => 'fade',
37       'speed' => 1000,
38     ];
39     $this->assertEquals($expected, $command->render());
40   }
41
42 }