ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
StandardPageTest Class Reference

Tests for the Standard Page. More...

+ Inheritance diagram for StandardPageTest:
+ Collaboration diagram for StandardPageTest:

Public Member Functions

 setUp ()
 
 testConstruction ()
 
 testGetContent ()
 
 testGetMetabar ()
 
 testGetMainbar ()
 
 testGetBreadcrumbs ()
 
 testGetLogo ()
 
 testHasLogo ()
 
 testGetResponsiveLogo ()
 
 testHasResponsiveLogo ()
 
 testWithWrongContents ()
 
 testGetTitle ()
 
 testWithTitle ()
 
 testWithShortTitle ()
 
 testWithViewTitle ()
 
 testWithMetaDatum ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML ($html)
 A more radical version of normalizeHTML. More...
 

Detailed Description

Tests for the Standard Page.

Definition at line 19 of file StandardPageTest.php.

Member Function Documentation

◆ setUp()

StandardPageTest::setUp ( )

Definition at line 21 of file StandardPageTest.php.

References mainbar(), and metabar().

21  : void
22  {
23  $sig_gen = new \ILIAS\UI\Implementation\Component\SignalGenerator();
24  $this->metabar = $this->createMock(MetaBar::class);
25  $this->mainbar = $this->createMock(MainBar::class);
26  $this->crumbs = $this->createMock(Breadcrumbs::class);
27  $this->logo = $this->createMock(Image::class);
28  $this->logo->method("getCanonicalName")->willReturn("Logo Stub");
29  $this->responsive_logo = $this->createMock(Image::class);
30  $this->responsive_logo->method("getCanonicalName")->willReturn("Responsive Logo Stub");
31  $this->contents = array(new Legacy('some content', $sig_gen));
32  $this->title = 'pagetitle';
33 
34  $this->factory = new Page\Factory();
35  $this->stdpage = $this->factory->standard(
36  $this->contents,
37  $this->metabar,
38  $this->mainbar,
39  $this->crumbs,
40  $this->logo,
41  null,
42  $this->title
43  )->withResponsiveLogo($this->responsive_logo);
44  }
This describes the Legacy-Slate.
Definition: Legacy.php:10
metabar()
Definition: metabar.php:2
mainbar()
Definition: mainbar.php:2
+ Here is the call graph for this function:

◆ testConstruction()

StandardPageTest::testConstruction ( )

Definition at line 46 of file StandardPageTest.php.

46  : void
47  {
48  $this->assertInstanceOf(
49  "ILIAS\\UI\\Component\\Layout\\Page\\Standard",
50  $this->stdpage
51  );
52  }

◆ testGetBreadcrumbs()

StandardPageTest::testGetBreadcrumbs ( )

Definition at line 78 of file StandardPageTest.php.

78  : void
79  {
80  $this->assertEquals(
81  $this->crumbs,
82  $this->stdpage->getBreadcrumbs()
83  );
84  }

◆ testGetContent()

StandardPageTest::testGetContent ( )

Definition at line 54 of file StandardPageTest.php.

54  : void
55  {
56  $this->assertEquals(
57  $this->contents,
58  $this->stdpage->getContent()
59  );
60  }

◆ testGetLogo()

StandardPageTest::testGetLogo ( )

Definition at line 86 of file StandardPageTest.php.

86  : void
87  {
88  $this->assertEquals(
89  $this->logo,
90  $this->stdpage->getLogo()
91  );
92  }

◆ testGetMainbar()

StandardPageTest::testGetMainbar ( )

Definition at line 70 of file StandardPageTest.php.

References mainbar().

70  : void
71  {
72  $this->assertEquals(
73  $this->mainbar,
74  $this->stdpage->getMainbar()
75  );
76  }
mainbar()
Definition: mainbar.php:2
+ Here is the call graph for this function:

◆ testGetMetabar()

StandardPageTest::testGetMetabar ( )

Definition at line 62 of file StandardPageTest.php.

References metabar().

62  : void
63  {
64  $this->assertEquals(
65  $this->metabar,
66  $this->stdpage->getMetabar()
67  );
68  }
metabar()
Definition: metabar.php:2
+ Here is the call graph for this function:

◆ testGetResponsiveLogo()

StandardPageTest::testGetResponsiveLogo ( )

Definition at line 99 of file StandardPageTest.php.

99  : void
100  {
101  $this->assertEquals(
102  $this->responsive_logo,
103  $this->stdpage->getResponsiveLogo()
104  );
105  }

◆ testGetTitle()

StandardPageTest::testGetTitle ( )

Definition at line 124 of file StandardPageTest.php.

124  : void
125  {
126  $this->assertEquals(
127  $this->title,
128  $this->stdpage->getTitle()
129  );
130  }

◆ testHasLogo()

StandardPageTest::testHasLogo ( )

Definition at line 94 of file StandardPageTest.php.

94  : void
95  {
96  $this->assertTrue($this->stdpage->hasLogo());
97  }

◆ testHasResponsiveLogo()

StandardPageTest::testHasResponsiveLogo ( )

Definition at line 107 of file StandardPageTest.php.

107  : void
108  {
109  $this->assertTrue($this->stdpage->hasResponsiveLogo());
110  }

◆ testWithMetaDatum()

StandardPageTest::testWithMetaDatum ( )

Definition at line 157 of file StandardPageTest.php.

158  {
159  $meta_datum_key = 'meta_datum_key';
160  $meta_datum_value = 'meta_datum_value';
161  $meta_data = [$meta_datum_key => $meta_datum_value];
162  $this->assertEquals(
163  $meta_data,
164  $this->stdpage->withAdditionalMetaDatum($meta_datum_key, $meta_datum_value)->getMetaData()
165  );
166  }

◆ testWithShortTitle()

StandardPageTest::testWithShortTitle ( )

Definition at line 140 of file StandardPageTest.php.

140  : void
141  {
142  $title = 'some short title';
143  $this->assertEquals(
144  $title,
145  $this->stdpage->withShortTitle($title)->getShortTitle()
146  );
147  }

◆ testWithTitle()

StandardPageTest::testWithTitle ( )

Definition at line 132 of file StandardPageTest.php.

132  : void
133  {
134  $title = 'some title';
135  $this->assertEquals(
136  $title,
137  $this->stdpage->withTitle($title)->getTitle()
138  );
139  }

◆ testWithViewTitle()

StandardPageTest::testWithViewTitle ( )

Definition at line 148 of file StandardPageTest.php.

148  : void
149  {
150  $title = 'some view title';
151  $this->assertEquals(
152  $title,
153  $this->stdpage->withViewTitle($title)->getViewTitle()
154  );
155  }

◆ testWithWrongContents()

StandardPageTest::testWithWrongContents ( )

Definition at line 112 of file StandardPageTest.php.

References mainbar(), and metabar().

112  : void
113  {
114  $this->expectException(TypeError::class);
115  $this->stdpage = $this->factory->standard(
116  $this->metabar,
117  $this->mainbar,
118  'string is not allowed here',
119  $this->crumbs,
120  $this->logo
121  );
122  }
metabar()
Definition: metabar.php:2
mainbar()
Definition: mainbar.php:2
+ Here is the call graph for this function:

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