Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Ajax / OpenOffCanvasDialogCommandTest.php
index e2d933a6577d6e1a563efec19ecbf37038c2582e..eca0c58f8a99f7c543aa1fe15b1a8afd0c56cafd 100644 (file)
@@ -13,9 +13,11 @@ class OpenOffCanvasDialogCommandTest extends UnitTestCase {
 
   /**
    * @covers ::render
+   *
+   * @dataProvider dialogPosition
    */
-  public function testRender() {
-    $command = new OpenOffCanvasDialogCommand('Title', '<p>Text!</p>', ['url' => 'example']);
+  public function testRender($position) {
+    $command = new OpenOffCanvasDialogCommand('Title', '<p>Text!</p>', ['url' => 'example'], NULL, $position);
 
     $expected = [
       'command' => 'openDialog',
@@ -31,8 +33,9 @@ class OpenOffCanvasDialogCommandTest extends UnitTestCase {
         'draggable' => FALSE,
         'drupalAutoButtons' => FALSE,
         'buttons' => [],
-        'dialogClass' => 'ui-dialog-off-canvas',
+        'dialogClass' => 'ui-dialog-off-canvas ui-dialog-position-' . $position,
         'width' => 300,
+        'drupalOffCanvasPosition' => $position,
       ],
       'effect' => 'fade',
       'speed' => 1000,
@@ -40,4 +43,16 @@ class OpenOffCanvasDialogCommandTest extends UnitTestCase {
     $this->assertEquals($expected, $command->render());
   }
 
+  /**
+   * The data provider for potential dialog positions.
+   *
+   * @return array
+   */
+  public static function dialogPosition() {
+    return [
+      ['side'],
+      ['top'],
+    ];
+  }
+
 }