Definition at line 33 of file ShowOnLoginPageTest.php.
◆ testConstruct()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ShowOnLoginPageTest::testConstruct |
( |
| ) |
|
Definition at line 37 of file ShowOnLoginPageTest.php.
39 $this->assertInstanceOf(ShowOnLoginPage::class,
new ShowOnLoginPage($this->mock(Provide::class), $this->mock(UI::class), $this->fail(...)));
◆ testInvoke()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ShowOnLoginPageTest::testInvoke |
( |
| ) |
|
Definition at line 51 of file ShowOnLoginPageTest.php.
References $url.
53 $translated =
'Translated<br/>';
56 $legacy = $this->mock(Legacy\Content::class);
57 $legacy_factory = $this->mock(Legacy\Factory::class);
59 ->expects($this->once())
61 ->willReturn($legacy);
64 $template = $this->mock(ilTemplate::class);
66 [
'LABEL', htmlentities($translated)],
70 ->expects(self::exactly(2))
71 ->method(
'setVariable')
73 function (
string $k,
string $v) use (&$expected) {
74 [$ek, $ev] = array_shift($expected);
75 $this->assertEquals($ek, $k);
76 $this->assertEquals($ev, $v);
80 $template->expects(self::once())->method(
'get')->willReturn(
'Rendered');
82 $instance =
new ShowOnLoginPage($this->mockTree(Provide::class, [
83 'document' => [
'repository' => [
'countAll' => 1]],
84 'publicPage' => [
'url' =>
$url],
85 ]), $this->mockTree(UI::class, [
87 'create' => $this->mockMethod(UIFactory::class,
'legacy', [], $legacy_factory),
88 ]), fn() => $template);
92 $this->assertSame(1, count($array));
93 $this->assertSame($legacy, $array[0]);
◆ testInvokeWithoutDocuments()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ShowOnLoginPageTest::testInvokeWithoutDocuments |
( |
| ) |
|
Definition at line 42 of file ShowOnLoginPageTest.php.
44 $instance =
new ShowOnLoginPage($this->mockTree(Provide::class, [
45 'document' => [
'repository' => [
'countAll' => 0]],
46 ]), $this->mock(UI::class), $this->fail(...));
48 $this->assertSame([], $instance());
The documentation for this class was generated from the following file: