19declare(strict_types=1);
23require_once(
'vendor/composer/vendor/autoload.php');
24require_once(__DIR__ .
'/../../../Base.php');
33use PHPUnit\Framework\Attributes\DataProvider;
48 $this->html_content = $this->createMock(Content::class);
49 $this->html_content->method(
'getContent')->willReturn(
'ILIAS HTML Content');
51 $this->logo =
'cid:ILIAS Logo';
52 $this->installation_title =
'ILIAS Installation Title';
53 $this->stylesheet_path = __FILE__;
54 $this->uri = $this->createMock(URI::class);
55 $this->uri->method(
'getBaseURI')->willReturn(
'ILIAS Link URI');
56 $this->footer_url = $this->createMock(DataLink::class);
57 $this->footer_url->method(
'getLabel')->willReturn(
'ILIAS Link Label');
58 $this->footer_url->method(
'getURL')->willReturn($this->uri);
61 $this->mailpage = $this->
factory->mail(
62 $this->stylesheet_path,
64 $this->installation_title,
72 static::assertInstanceOf(
81 [
'html_content',
'getContent',
'assertContains'],
82 [
'logo',
'getLogoURL',
'assertEquals'],
83 [
'installation_title',
'getInstallationTitle',
'assertEquals'],
84 [
'stylesheet_path',
'getStyleSheetPath',
'assertEquals'],
85 [
'footer_url',
'getFooterURL',
'assertEquals'],
89 #[DataProvider('provideGetData')]
90 public function testGet(mixed $expected,
string $method_to_call,
string $assert_method): void
92 static::$assert_method(
94 $this->mailpage->$method_to_call(),
100 $renderer = $this->getDefaultRenderer(
null, [$this->html_content]);
102 $this->stylesheet_path,
104 $this->installation_title,
110 $expected = $this->brutallyTrimHTML(
'
115 <table class="w-750 center">
116 <tr class="rowheight"></tr>
118 <td class="image-data">
119 <img class="logo" src="' . $this->logo .
'" alt="Logo">
121 <td class="installation-text">
123 <strong>' . $this->installation_title .
'</strong>
127 <tr class="rowheight"></tr>
133 <table class="w-750 center">
134 <tr class="headerheight"></tr>
136 <td class="font-definition">
137 ' .
$renderer->render($this->html_content) .
'
140 <tr class="headerheight"></tr>
146 <table class="w-750 center">
148 <td class="font-definition">
149 <span>' . $this->installation_title .
'</span>
151 <a href="ILIAS Link URI">ILIAS Link Label</a>
160 static::assertStringContainsString($expected, $html);
166 public function link(): Link\Factory
168 return new Link\Factory();
testGet(mixed $expected, string $method_to_call, string $assert_method)
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)