19 declare(strict_types=1);
33 require_once __DIR__ .
'/../../ContainerMock.php';
41 $this->assertInstanceOf(ShowOnLoginPage::class,
new ShowOnLoginPage($this->mock(Provide::class), $this->mock(UI::class), $this->fail(...)));
47 'document' => [
'repository' => [
'countAll' => 0]],
48 ]), $this->mock(UI::class), $this->fail(...));
50 $this->assertSame([], $instance());
55 $translated =
'Translated<br/>';
57 $legacy = $this->mock(Legacy::class);
59 $template = $this->mock(ilTemplate::class);
60 $template->expects(self::exactly(2))->method(
'setVariable')->withConsecutive([
'LABEL', htmlentities($translated)], [
'HREF',
$url]);
61 $template->expects(self::once())->method(
'get')->willReturn(
'Rendered');
64 'document' => [
'repository' => [
'countAll' => 1]],
65 'publicPage' => [
'url' =>
$url],
66 ]), $this->mockTree(UI::class, [
68 'create' => $this->mockMethod(UIFactory::class,
'legacy', [
'Rendered'], $legacy),
69 ]), fn() => $template);
73 $this->assertSame(1, count($array));
74 $this->assertSame($legacy, $array[0]);
testInvokeWithoutDocuments()