ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
PopoverTest Class Reference

Class PopoverTest. More...

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

Public Member Functions

 getFactory ()
 
 testImplementsInterface ()
 
 testThatPositionIsAutoByDefault ()
 
 testWithPosition ()
 
 testRenderStandard ()
 
 testRenderListing ()
 
 testRenderAsync ()
 

Protected Member Functions

 getExpectedStandardHTML (string $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 34 of file PopoverTest.php.

Member Function Documentation

◆ getExpectedStandardHTML()

PopoverTest::getExpectedStandardHTML ( string  $content)
protected

Definition at line 98 of file PopoverTest.php.

Referenced by testRenderStandard().

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 testRenderAsync(), and testRenderStandard().

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...
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testImplementsInterface()

PopoverTest::testImplementsInterface ( )

Definition at line 47 of file PopoverTest.php.

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...

◆ testRenderAsync()

PopoverTest::testRenderAsync ( )

Definition at line 91 of file PopoverTest.php.

References 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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:13
+ Here is the call graph for this function:

◆ testRenderListing()

PopoverTest::testRenderListing ( )

Definition at line 85 of file PopoverTest.php.

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

◆ testRenderStandard()

PopoverTest::testRenderStandard ( )

Definition at line 76 of file PopoverTest.php.

References getExpectedStandardHTML(), getFactory(), and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

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  }
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...
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:13
+ Here is the call graph for this function:

◆ testThatPositionIsAutoByDefault()

PopoverTest::testThatPositionIsAutoByDefault ( )

Definition at line 56 of file PopoverTest.php.

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...

◆ testWithPosition()

PopoverTest::testWithPosition ( )

Definition at line 63 of file PopoverTest.php.

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...

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