ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
PopoverTest Class Reference

Class PopoverTest. More...

+ Inheritance diagram for PopoverTest:
+ Collaboration diagram for PopoverTest:

Public Member Functions

 getFactory ()
 
 test_implements_interface ()
 
 test_that_position_is_auto_by_default ()
 
 test_with_position ()
 
 test_render_standard ()
 
 test_render_listing ()
 
 test_render_async ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Protected Member Functions

 getExpectedStandardHTML (string $content)
 
- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

Class PopoverTest.

Tests on the Popover component implementation

Author
Stefan Wanzenried sw@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 34 of file PopoverTest.php.

Member Function Documentation

◆ getExpectedStandardHTML()

PopoverTest::getExpectedStandardHTML ( string  $content)
protected

Definition at line 98 of file PopoverTest.php.

Referenced by test_render_standard().

98  : string
99  {
100  return '<div class="il-standard-popover-content" style="display:none;" id="id_1">' . $content . '</div>';
101  }
+ Here is the caller graph for this function:

◆ getFactory()

PopoverTest::getFactory ( )

Definition at line 36 of file PopoverTest.php.

References Vendor\Package\$f, and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

Referenced by test_render_async(), and test_render_standard().

36  : NoUIFactory
37  {
38  return new class () extends NoUIFactory {
39  public function legacy(string $content): I\Component\Legacy\Legacy
40  {
41  $f = new I\Component\Legacy\Factory(new I\Component\SignalGenerator());
42  return $f->legacy($content);
43  }
44  };
45  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_implements_interface()

PopoverTest::test_implements_interface ( )

Definition at line 47 of file PopoverTest.php.

References $factory.

47  : void
48  {
49  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
50  $standard = $factory->standard(new DummyComponent());
51  $this->assertInstanceOf("ILIAS\\UI\\Component\\Popover\\Standard", $standard);
52  $listing = $factory->listing([new DummyComponent()]);
53  $this->assertInstanceOf("ILIAS\\UI\\Component\\Popover\\Listing", $listing);
54  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$factory
Definition: metadata.php:75

◆ test_render_async()

PopoverTest::test_render_async ( )

Definition at line 91 of file PopoverTest.php.

References $factory, ILIAS_UI_TestBase\getDefaultRenderer(), getFactory(), and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

91  : void
92  {
93  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
94  $popover = $factory->standard($this->getFactory()->legacy('myContent'))->withAsyncContentUrl('/blub/');
95  $this->assertEquals('', $this->getDefaultRenderer()->render($popover));
96  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$factory
Definition: metadata.php:75
+ Here is the call graph for this function:

◆ test_render_listing()

PopoverTest::test_render_listing ( )

Definition at line 85 of file PopoverTest.php.

85  : void
86  {
87  // TODO Listing not yet in framework core
88  $this->assertTrue(true);
89  }

◆ test_render_standard()

PopoverTest::test_render_standard ( )

Definition at line 76 of file PopoverTest.php.

References $factory, ILIAS_UI_TestBase\getDefaultRenderer(), getExpectedStandardHTML(), getFactory(), ILIAS\UI\examples\MainControls\Slate\Legacy\legacy(), and ILIAS_UI_TestBase\normalizeHTML().

76  : void
77  {
78  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
79  $popover = $factory->standard($this->getFactory()->legacy('myContent'));
80  $expected = $this->normalizeHTML($this->getExpectedStandardHTML('myContent'));
81  $actual = $this->normalizeHTML($this->getDefaultRenderer()->render($popover));
82  $this->assertEquals($expected, $actual);
83  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
getExpectedStandardHTML(string $content)
Definition: PopoverTest.php:98
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
normalizeHTML(string $html)
Definition: Base.php:422
$factory
Definition: metadata.php:75
+ Here is the call graph for this function:

◆ test_that_position_is_auto_by_default()

PopoverTest::test_that_position_is_auto_by_default ( )

Definition at line 56 of file PopoverTest.php.

References $factory.

56  : void
57  {
58  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
59  $popover = $factory->standard(new DummyComponent());
60  $this->assertEquals(Popover::POS_AUTO, $popover->getPosition());
61  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$factory
Definition: metadata.php:75

◆ test_with_position()

PopoverTest::test_with_position ( )

Definition at line 63 of file PopoverTest.php.

References $factory.

63  : void
64  {
65  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
66  $popover1 = $factory->standard(new DummyComponent());
67  $popover2 = $popover1->withVerticalPosition();
68  $popover3 = $popover2->withHorizontalPosition();
69  $this->assertEquals(Popover::POS_AUTO, $popover1->getPosition());
70  $this->assertEquals(Popover::POS_VERTICAL, $popover2->getPosition());
71  $this->assertEquals(Popover::POS_HORIZONTAL, $popover3->getPosition());
72  $this->assertEquals($popover1->getContent(), $popover2->getContent());
73  $this->assertEquals($popover1->getContent(), $popover3->getContent());
74  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$factory
Definition: metadata.php:75

The documentation for this class was generated from the following file: