19 declare(strict_types=1);
39 require_once __DIR__ .
'/../../ContainerMock.php';
47 $this->assertInstanceOf(ModifyFooter::class,
new ModifyFooter(
48 $this->mock(UI::class),
49 $this->mock(User::class),
50 $this->mock(Provide::class),
59 $return = fn() => null;
60 $footer = fn() => $return;
63 $this->mock(UI::class),
64 $this->mockTree(User::class, [
'acceptedVersion' =>
new Ok($this->mock(DocumentContent::class))]),
65 $this->mock(Provide::class),
67 fn() => $this->mock(ilTemplate::class),
71 $this->assertSame($return, $instance($footer));
76 $dummy_uri = $this->mock(URI::class);
77 $return = fn() => null;
78 $footer =
function (
$id, $title, $uri) use ($dummy_uri, $return) {
79 $this->assertSame(
'foo',
$id);
80 $this->assertSame(
'translated', $title);
81 $this->assertSame($dummy_uri, $uri);
86 $this->mockTree(UI::class, [
'txt' =>
'translated']),
87 $this->mockTree(User::class, [
'acceptedVersion' =>
new Error(
'Not found.'),
'isLoggedIn' =>
false]),
88 $this->mockTree(Provide::class, [
'id' =>
'foo']),
90 fn() => $this->mock(ilTemplate::class),
94 $this->assertSame($return, $instance($footer));
100 $this->mock(UI::class),
101 $this->mock(User::class),
102 $this->mock(Provide::class),
104 fn() => $this->mock(ilTemplate::class),
108 $modal = $instance->renderModal($this->mock(DocumentContent::class));
109 $this->assertInstanceOf(Modal::class, $modal);
114 $template = $this->mock(ilTemplate::class);
115 $template->expects(self::exactly(3))->method(
'setVariable');
116 $template->expects(self::once())->method(
'get');
119 $this->mock(UI::class),
120 $this->mock(User::class),
121 $this->mock(Provide::class),
127 $this->assertInstanceOf(Component::class, $instance->withdrawalButton());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A result encapsulates a value or an error and simplifies the handling of those.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins