ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PopoverTest Class Reference

Class PopoverTest. More...

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

Public Member Functions

 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 ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Protected Member Functions

 getExpectedStandardHTML ($content)
 

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 15 of file PopoverTest.php.

Member Function Documentation

◆ getExpectedStandardHTML()

PopoverTest::getExpectedStandardHTML (   $content)
protected
Parameters
string$content
Returns
string

Definition at line 72 of file PopoverTest.php.

73 {
74 return '<div class="il-standard-popover-content" style="display:none;" id="id_1">' . $content . '</div>';
75 }

Referenced by test_render_standard().

+ Here is the caller graph for this function:

◆ test_implements_interface()

PopoverTest::test_implements_interface ( )

Definition at line 17 of file PopoverTest.php.

18 {
19 $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator);
20 $standard = $factory->standard(new DummyComponent());
21 $this->assertInstanceOf("ILIAS\\UI\\Component\\Popover\\Standard", $standard);
22 $listing = $factory->listing([new DummyComponent()]);
23 $this->assertInstanceOf("ILIAS\\UI\\Component\\Popover\\Listing", $listing);
24 }
$factory
Definition: metadata.php:43

References $factory.

◆ test_render_async()

PopoverTest::test_render_async ( )

Definition at line 61 of file PopoverTest.php.

62 {
63 $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator);
64 $popover = $factory->standard(new I\Component\Legacy\Legacy('myContent'))->withAsyncContentUrl('/blub/');
65 $this->assertEquals('', $this->getDefaultRenderer()->render($popover));
66 }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228

References $factory, and ILIAS_UI_TestBase\getDefaultRenderer().

+ Here is the call graph for this function:

◆ test_render_listing()

PopoverTest::test_render_listing ( )

Definition at line 55 of file PopoverTest.php.

56 {
57 // TODO Listing not yet in framework core
58 $this->assertTrue(true);
59 }

◆ test_render_standard()

PopoverTest::test_render_standard ( )

Definition at line 46 of file PopoverTest.php.

47 {
48 $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator);
49 $popover = $factory->standard(new I\Component\Legacy\Legacy('myContent'));
50 $expected = $this->normalizeHTML($this->getExpectedStandardHTML('myContent'));
51 $actual = $this->normalizeHTML($this->getDefaultRenderer()->render($popover));
52 $this->assertEquals($expected, $actual);
53 }
normalizeHTML($html)
Definition: Base.php:261
getExpectedStandardHTML($content)
Definition: PopoverTest.php:72

References $factory, ILIAS_UI_TestBase\getDefaultRenderer(), getExpectedStandardHTML(), and ILIAS_UI_TestBase\normalizeHTML().

+ 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 26 of file PopoverTest.php.

27 {
28 $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator);
29 $popover = $factory->standard(new DummyComponent());
30 $this->assertEquals(Popover::POS_AUTO, $popover->getPosition());
31 }

References $factory.

◆ test_with_position()

PopoverTest::test_with_position ( )

Definition at line 33 of file PopoverTest.php.

34 {
35 $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator);
36 $popover1 = $factory->standard(new DummyComponent());
37 $popover2 = $popover1->withVerticalPosition();
38 $popover3 = $popover2->withHorizontalPosition();
39 $this->assertEquals(Popover::POS_AUTO, $popover1->getPosition());
40 $this->assertEquals(Popover::POS_VERTICAL, $popover2->getPosition());
41 $this->assertEquals(Popover::POS_HORIZONTAL, $popover3->getPosition());
42 $this->assertEquals($popover1->getContent(), $popover2->getContent());
43 $this->assertEquals($popover1->getContent(), $popover3->getContent());
44 }

References $factory.


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