19 declare(strict_types=1);
31 require_once __DIR__ .
'/../../ContainerMock.php';
39 $this->assertInstanceOf(ShowOnLoginPage::class,
new ShowOnLoginPage($this->mock(Provide::class), $this->mock(UI::class), $this->fail(...)));
45 'document' => [
'repository' => [
'countAll' => 0]],
46 ]), $this->mock(UI::class), $this->fail(...));
48 $this->assertSame([], $instance());
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');
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()