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/>';
55 $legacy = $this->mock(Legacy::class);
57 $template = $this->mock(ilTemplate::class);
59 [
'LABEL', htmlentities($translated)],
63 ->expects(self::exactly(2))
64 ->method(
'setVariable')
66 function (
string $k,
string $v) use (&$expected) {
67 [$ek, $ev] = array_shift($expected);
68 $this->assertEquals($ek, $k);
69 $this->assertEquals($ev, $v);
73 $template->expects(self::once())->method(
'get')->willReturn(
'Rendered');
76 'document' => [
'repository' => [
'countAll' => 1]],
77 'publicPage' => [
'url' =>
$url],
78 ]), $this->mockTree(UI::class, [
80 'create' => $this->mockMethod(UIFactory::class,
'legacy', [
'Rendered'], $legacy),
81 ]), fn() => $template);
85 $this->assertSame(1, count($array));
86 $this->assertSame($legacy, $array[0]);
testInvokeWithoutDocuments()