ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
AlignmentTest Class Reference

Tests for the Alignment Layout. More...

+ Inheritance diagram for AlignmentTest:
+ Collaboration diagram for AlignmentTest:

Public Member Functions

 testAlignmentBasicConstruction ()
 
 testAlignmentEvenlyRendering ()
 
 testAlignmentDynamicalRendering ()
 
 testAlignmentVerticalRendering ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getHelpTextRetriever ()
 
 getUploadLimitResolver ()
 
 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)
 

Additional Inherited Members

- 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

Tests for the Alignment Layout.

Definition at line 30 of file AlignmentTest.php.

Member Function Documentation

◆ testAlignmentBasicConstruction()

AlignmentTest::testAlignmentBasicConstruction ( )

Definition at line 32 of file AlignmentTest.php.

References Vendor\Package\$f.

32  : void
33  {
34  $f = new C\Layout\Alignment\Factory();
35  $blocks = [
36  new C\Legacy\Legacy('block', new C\SignalGenerator()),
37  new C\Legacy\Legacy('block', new C\SignalGenerator())
38  ];
39  $vert = $f->vertical(...$blocks);
40  $this->assertInstanceOf(I\Layout\Alignment\Alignment::class, $vert);
41  $this->assertEquals($blocks, $vert->getBlocks());
42  $ed = $f->horizontal()->dynamicallyDistributed(...$blocks);
43  $this->assertInstanceOf(I\Layout\Alignment\Alignment::class, $ed);
44  $this->assertEquals($blocks, $ed->getBlocks());
45  $dd = $f->horizontal()->dynamicallyDistributed(...$blocks);
46  $this->assertInstanceOf(I\Layout\Alignment\Alignment::class, $dd);
47  $this->assertEquals($blocks, $dd->getBlocks());
48  }
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...

◆ testAlignmentDynamicalRendering()

AlignmentTest::testAlignmentDynamicalRendering ( )

Definition at line 71 of file AlignmentTest.php.

References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().

71  : void
72  {
73  $f = new C\Layout\Alignment\Factory();
74  $blocks = [
75  new C\Legacy\Legacy('block', new C\SignalGenerator()),
76  new C\Legacy\Legacy('block', new C\SignalGenerator())
77  ];
78  $renderer = $this->getDefaultRenderer();
79 
80  $dd = $f->horizontal()->dynamicallyDistributed(...$blocks);
81  $actual = $this->brutallyTrimHTML($renderer->render($dd));
82  $expected = $this->brutallyTrimHTML('
83  <div class="c-layout-alignment c-layout-alignment--horizontal-dynamically">
84  <div class=c-layout-alignment__block>block</div>
85  <div class=c-layout-alignment__block>block</div>
86  </div>
87  ');
88  $this->assertEquals($expected, $actual);
89  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:475
+ Here is the call graph for this function:

◆ testAlignmentEvenlyRendering()

AlignmentTest::testAlignmentEvenlyRendering ( )

Definition at line 50 of file AlignmentTest.php.

References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().

50  : void
51  {
52  $f = new C\Layout\Alignment\Factory();
53  $blocks = [
54  new C\Legacy\Legacy('block', new C\SignalGenerator()),
55  new C\Legacy\Legacy('block', new C\SignalGenerator())
56  ];
57  $renderer = $this->getDefaultRenderer();
58 
59  $ed = $f->horizontal()->evenlyDistributed(...$blocks);
60 
61  $actual = $this->brutallyTrimHTML($renderer->render($ed));
62  $expected = $this->brutallyTrimHTML('
63  <div class="c-layout-alignment c-layout-alignment--horizontal-evenly">
64  <div class=c-layout-alignment__block>block</div>
65  <div class=c-layout-alignment__block>block</div>
66  </div>
67  ');
68  $this->assertEquals($expected, $actual);
69  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:475
+ Here is the call graph for this function:

◆ testAlignmentVerticalRendering()

AlignmentTest::testAlignmentVerticalRendering ( )

Definition at line 91 of file AlignmentTest.php.

References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().

91  : void
92  {
93  $f = new C\Layout\Alignment\Factory();
94  $blocks = [
95  new C\Legacy\Legacy('block', new C\SignalGenerator()),
96  new C\Legacy\Legacy('block', new C\SignalGenerator())
97  ];
98  $renderer = $this->getDefaultRenderer();
99 
100  $vert = $f->vertical(...$blocks);
101  $actual = $this->brutallyTrimHTML($renderer->render($vert));
102  $expected = $this->brutallyTrimHTML('
103  <div class="c-layout-alignment c-layout-alignment--vertical">
104  <div class=c-layout-alignment__block>block</div>
105  <div class=c-layout-alignment__block>block</div>
106  </div>
107  ');
108  $this->assertEquals($expected, $actual);
109  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:475
+ Here is the call graph for this function:

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