19 declare(strict_types=1);
36 require_once __DIR__ .
'/../../ContainerMock.php';
45 $this->mock(User::class),
46 $this->mock(UI::class),
47 $this->mock(Routing::class),
48 $this->mock(Settings::class),
50 $this->mock(Provide::class),
58 $this->mock(User::class),
59 $this->mock(UI::class),
60 $this->mock(Routing::class),
61 $this->mock(Settings::class),
63 $this->mock(Provide::class),
67 $array = $instance->showValidatePasswordMessage();
68 $this->assertSame(2, count($array));
69 $this->assertInstanceOf(Component::class, $array[0]);
70 $this->assertInstanceOf(Component::class, $array[1]);
76 $this->mockTree(User::class, [
'withdrawalRequested' => [
'value' =>
true]]),
77 $this->mock(UI::class),
78 $this->mock(Routing::class),
79 $this->mock(Settings::class),
81 $this->mock(Provide::class),
85 $this->assertTrue($instance->isOnGoing());
90 $setting = $this->mock(Setting::class);
91 $setting->expects(self::once())->method(
'update')->with(
true);
94 $this->mockTree(User::class, [
'cannotAgree' =>
false,
'neverAgreed' =>
false,
'withdrawalRequested' =>
$setting]),
95 $this->mock(UI::class),
96 $this->mock(Routing::class),
97 $this->mock(Settings::class),
99 $this->mock(Provide::class),
103 $instance->withdrawalRequested();
109 $this->mockTree(User::class, [
'cannotAgree' =>
true,
'neverAgreed' =>
false]),
110 $this->mock(UI::class),
111 $this->mock(Routing::class),
112 $this->mock(Settings::class),
114 $this->mock(Provide::class),
118 $instance->withdrawalRequested();
119 $this->assertTrue(
true);
124 $main_template = $this->mock(ilGlobalTemplateInterface::class);
125 $main_template->expects(self::once())->method(
'setOnScreenMessage');
128 $this->mock(User::class),
129 $this->mockTree(UI::class, [
'mainTemplate' => $main_template]),
130 $this->mock(Routing::class),
131 $this->mock(Settings::class),
133 $this->mock(Provide::class),
137 $instance->withdrawalFinished();
143 $this->mock(User::class),
144 $this->mock(UI::class),
145 $this->mock(Routing::class),
146 $this->mock(Settings::class),
148 $this->mock(Provide::class),
152 $this->assertInstanceOf(PageFragment::class, $instance->showWithdraw(
'foo',
''));