ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ModalTest.php
Go to the documentation of this file.
1 <?php
2 
3 require_once(__DIR__ . '/ModalBase.php');
4 
5 use \ILIAS\UI\Component as C;
6 
12 class ModalTest extends ModalBase
13 {
15  {
16  $modal = $this->getModal();
17  $this->assertEquals(true, $modal->getCloseWithKeyboard());
18  $modal = $modal->withCloseWithKeyboard(false);
19  $this->assertEquals(false, $modal->getCloseWithKeyboard());
20  }
21 
22  public function test_with_async_rendered_url()
23  {
24  $modal = $this->getModal()->withAsyncRenderUrl('/fake/async/url');
25  $this->assertEquals('/fake/async/url', $modal->getAsyncRenderUrl());
26  }
27 
28  public function test_get_signals()
29  {
30  $modal = $this->getModal();
31  $show = $modal->getShowSignal();
32  $close = $modal->getCloseSignal();
33  $this->assertEquals('signal_1', "$show");
34  $this->assertEquals('signal_2', "$close");
35  $modal2 = $modal->withAsyncRenderUrl('blub');
36  $show = $modal2->getShowSignal();
37  $close = $modal2->getCloseSignal();
38  $this->assertEquals('signal_1', "$show");
39  $this->assertEquals('signal_2', "$close");
40  }
41 
42  public function test_with_reset_signals()
43  {
44  $modal = $this->getModal();
45  $modal2 = $modal->withResetSignals();
46  $show = $modal2->getShowSignal();
47  $close = $modal2->getCloseSignal();
48  $this->assertEquals('signal_3', "$show");
49  $this->assertEquals('signal_4', "$close");
50  }
51 
52  protected function getModal()
53  {
54  return new ModalMock(new IncrementalSignalGenerator());
55  }
56 }
57 
59 {
60  public function getCanonicalName()
61  {
62  return "Modal Mock";
63  }
64 }
test_with_reset_signals()
Definition: ModalTest.php:42
Tests on abstract base class for modals.
Definition: ModalTest.php:12
test_with_close_with_keyboard()
Definition: ModalTest.php:14
getCanonicalName()
Get the canonical name of the component.
Definition: ModalTest.php:60
test_get_signals()
Definition: ModalTest.php:28
Base class for modal tests.
Definition: ModalBase.php:12
test_with_async_rendered_url()
Definition: ModalTest.php:22