X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Ftests%2FDrupal%2FTests%2FCore%2FAjax%2FOpenOffCanvasDialogCommandTest.php;fp=web%2Fcore%2Ftests%2FDrupal%2FTests%2FCore%2FAjax%2FOpenOffCanvasDialogCommandTest.php;h=eca0c58f8a99f7c543aa1fe15b1a8afd0c56cafd;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=e2d933a6577d6e1a563efec19ecbf37038c2582e;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php b/web/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php index e2d933a65..eca0c58f8 100644 --- a/web/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php +++ b/web/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php @@ -13,9 +13,11 @@ class OpenOffCanvasDialogCommandTest extends UnitTestCase { /** * @covers ::render + * + * @dataProvider dialogPosition */ - public function testRender() { - $command = new OpenOffCanvasDialogCommand('Title', '

Text!

', ['url' => 'example']); + public function testRender($position) { + $command = new OpenOffCanvasDialogCommand('Title', '

Text!

', ['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'], + ]; + } + }