ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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 97 of file PopoverTest.php.

Referenced by testRenderStandard().

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

◆ getFactory()

PopoverTest::getFactory ( )

Definition at line 36 of file PopoverTest.php.

References 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(): I\Component\Legacy\Factory
40  {
41  return new I\Component\Legacy\Factory(new I\Component\SignalGenerator());
42  }
43  };
44  }
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testImplementsInterface()

PopoverTest::testImplementsInterface ( )

Definition at line 46 of file PopoverTest.php.

46  : void
47  {
48  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
49  $standard = $factory->standard(new DummyComponent());
50  $this->assertInstanceOf("ILIAS\\UI\\Component\\Popover\\Standard", $standard);
51  $listing = $factory->listing([new DummyComponent()]);
52  $this->assertInstanceOf("ILIAS\\UI\\Component\\Popover\\Listing", $listing);
53  }

◆ testRenderAsync()

PopoverTest::testRenderAsync ( )

Definition at line 90 of file PopoverTest.php.

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

90  : void
91  {
92  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
93  $popover = $factory->standard($this->getFactory()->legacy()->content('myContent'))->withAsyncContentUrl('/blub/');
94  $this->assertEquals('', $this->getDefaultRenderer()->render($popover));
95  }
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
+ Here is the call graph for this function:

◆ testRenderListing()

PopoverTest::testRenderListing ( )

Definition at line 84 of file PopoverTest.php.

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

◆ testRenderStandard()

PopoverTest::testRenderStandard ( )

Definition at line 75 of file PopoverTest.php.

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

75  : void
76  {
77  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
78  $popover = $factory->standard($this->getFactory()->legacy()->content('myContent'));
79  $expected = $this->normalizeHTML($this->getExpectedStandardHTML('myContent'));
80  $actual = $this->normalizeHTML($this->getDefaultRenderer()->render($popover));
81  $this->assertEquals($expected, $actual);
82  }
getExpectedStandardHTML(string $content)
Definition: PopoverTest.php:97
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
+ Here is the call graph for this function:

◆ testThatPositionIsAutoByDefault()

PopoverTest::testThatPositionIsAutoByDefault ( )

Definition at line 55 of file PopoverTest.php.

55  : void
56  {
57  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
58  $popover = $factory->standard(new DummyComponent());
59  $this->assertEquals(Popover::POS_AUTO, $popover->getPosition());
60  }

◆ testWithPosition()

PopoverTest::testWithPosition ( )

Definition at line 62 of file PopoverTest.php.

62  : void
63  {
64  $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator());
65  $popover1 = $factory->standard(new DummyComponent());
66  $popover2 = $popover1->withVerticalPosition();
67  $popover3 = $popover2->withHorizontalPosition();
68  $this->assertEquals(Popover::POS_AUTO, $popover1->getPosition());
69  $this->assertEquals(Popover::POS_VERTICAL, $popover2->getPosition());
70  $this->assertEquals(Popover::POS_HORIZONTAL, $popover3->getPosition());
71  $this->assertEquals($popover1->getContent(), $popover2->getContent());
72  $this->assertEquals($popover1->getContent(), $popover3->getContent());
73  }

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