19declare(strict_types=1);
23require_once(
'vendor/composer/vendor/autoload.php');
24require_once(__DIR__ .
'/../../../Base.php');
47 $this->html_content = $this->createMock(Content::class);
48 $this->html_content->method(
'getContent')->willReturn(
'ILIAS HTML Content');
50 $this->logo =
'cid:ILIAS Logo';
51 $this->installation_title =
'ILIAS Installation Title';
52 $this->stylesheet_path = __FILE__;
53 $this->uri = $this->createMock(URI::class);
54 $this->uri->method(
'getBaseURI')->willReturn(
'ILIAS Link URI');
55 $this->footer_url = $this->createMock(DataLink::class);
56 $this->footer_url->method(
'getLabel')->willReturn(
'ILIAS Link Label');
57 $this->footer_url->method(
'getURL')->willReturn($this->uri);
60 $this->mailpage = $this->
factory->mail(
61 $this->stylesheet_path,
63 $this->installation_title,
71 static::assertInstanceOf(
80 [
'html_content',
'getContent',
'assertContains'],
81 [
'logo',
'getLogoURL',
'assertEquals'],
82 [
'installation_title',
'getInstallationTitle',
'assertEquals'],
83 [
'stylesheet_path',
'getStyleSheetPath',
'assertEquals'],
84 [
'footer_url',
'getFooterURL',
'assertEquals'],
91 public function testGet(mixed $expected,
string $method_to_call,
string $assert_method): void
93 static::$assert_method(
95 $this->mailpage->$method_to_call(),
101 $renderer = $this->getDefaultRenderer(
null, [$this->html_content]);
103 $this->stylesheet_path,
105 $this->installation_title,
111 $expected = $this->brutallyTrimHTML(
'
116 <table class="w-750 center">
117 <tr class="rowheight"></tr>
119 <td class="image-data">
120 <img class="logo" src="' . $this->logo .
'" alt="Logo">
122 <td class="installation-text">
124 <strong>' . $this->installation_title .
'</strong>
128 <tr class="rowheight"></tr>
134 <table class="w-750 center">
135 <tr class="headerheight"></tr>
137 <td class="font-definition">
138 ' .
$renderer->render($this->html_content) .
'
141 <tr class="headerheight"></tr>
147 <table class="w-750 center">
149 <td class="font-definition">
150 <span>' . $this->installation_title .
'</span>
152 <a href="ILIAS Link URI">ILIAS Link Label</a>
161 static::assertStringContainsString($expected, $html);
167 public function link(): Link\Factory
169 return new Link\Factory();
testGet(mixed $expected, string $method_to_call, string $assert_method)
@dataProvider provideGetData
string $installation_title
Builds a Color from either hex- or rgb values.
A Link is the often used combination of a label and an URL.
The scope of this class is split ilias-conform URI's into components.
Provides common functionality for UI tests.
link(string $caption, string $href, bool $new_viewport=false)