5 require_once(
"libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../../Base.php");
8 use \ILIAS\UI\Component as
C;
9 use \ILIAS\UI\Component\MainControls\MetaBar;
10 use \ILIAS\UI\Component\MainControls\MainBar;
11 use \ILIAS\UI\Component\Breadcrumbs\Breadcrumbs;
12 use \ILIAS\UI\Component\Image\Image;
13 use \ILIAS\UI\Implementation\Component\Layout\Page;
14 use \ILIAS\UI\Implementation\Component\Legacy\Legacy;
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';
34 $this->factory =
new Page\Factory();
35 $this->stdpage = $this->factory->standard(
43 )->withResponsiveLogo($this->responsive_logo);
48 $this->assertInstanceOf(
49 "ILIAS\\UI\\Component\\Layout\\Page\\Standard",
58 $this->stdpage->getContent()
66 $this->stdpage->getMetabar()
74 $this->stdpage->getMainbar()
82 $this->stdpage->getBreadcrumbs()
90 $this->stdpage->getLogo()
96 $this->assertTrue($this->stdpage->hasLogo());
102 $this->responsive_logo,
103 $this->stdpage->getResponsiveLogo()
109 $this->assertTrue($this->stdpage->hasResponsiveLogo());
114 $this->expectException(TypeError::class);
115 $this->stdpage = $this->factory->standard(
118 'string is not allowed here',
128 $this->stdpage->getTitle()
134 $title =
'some title';
137 $this->stdpage->withTitle($title)->getTitle()
142 $title =
'some short title';
145 $this->stdpage->withShortTitle($title)->getShortTitle()
150 $title =
'some view title';
153 $this->stdpage->withViewTitle($title)->getViewTitle()
159 $meta_datum_key =
'meta_datum_key';
160 $meta_datum_value =
'meta_datum_value';
161 $meta_data = [$meta_datum_key => $meta_datum_value];
164 $this->stdpage->withAdditionalMetaDatum($meta_datum_key, $meta_datum_value)->getMetaData()
This describes the Legacy-Slate.
Tests for the Standard Page.
Provides common functionality for UI tests.