Definition at line 55 of file ConductorTest.php.
◆ agreement()
ILIAS\LegalDocuments\test\ConductorTest::agreement |
( |
string |
$method, |
|
|
string |
$gui, |
|
|
string |
$key, |
|
|
?ilGlobalTemplateInterface |
$main_template = null |
|
) |
| |
|
private |
Definition at line 323 of file ConductorTest.php.
References $container.
Referenced by ILIAS\LegalDocuments\test\ConductorTest\testAgree(), ILIAS\LegalDocuments\test\ConductorTest\testAgreeContent(), and ILIAS\LegalDocuments\test\ConductorTest\testWithdraw().
325 $constraint = $this->mock(Constraint::class);
327 $ctrl = $this->mock(ilCtrl::class);
328 $ctrl->expects(self::once())->method(
'setParameterByClass')->with($gui,
'id',
'foo');
330 $container = $this->mockTree(Container::class, [
331 'refinery' => [
'to' => [
'string' => $constraint]],
332 'http' => [
'wrapper' => [
'query' => $this->mockMethod(ArrayBasedRequestWrapper::class,
'retrieve', [
'id', $constraint],
'foo')]],
334 'mainTemplate' => $main_template ?? $this->mock(ilGlobalTemplateInterface::class),
335 'renderer' => $this->mock(Renderer::class),
340 $fragment = $this->mockMethod(PageFragment::class,
'render', [
$container->ui()->mainTemplate(),
$container->ui()->renderer()],
'rendered');
342 $internal = $this->mockMethod(Internal::class,
'get', [$key,
'foo'],
function (
string $g,
string $cmd) use ($fragment, $gui):
Result {
343 $this->assertSame($gui, $g);
344 $this->assertSame(
'some cmd', $cmd);
345 return new Ok($fragment);
348 $instance =
new Conductor(
$container, $internal, $this->mock(Routing::class));
350 return $instance->$method($gui,
'some cmd');
◆ agreeTypes()
static ILIAS\LegalDocuments\test\ConductorTest::agreeTypes |
( |
| ) |
|
|
static |
Definition at line 315 of file ConductorTest.php.
318 'Form type' => [ilLegalDocumentsAgreementGUI::class,
'agreement-form'],
319 'Public type' => [
'foo',
'public-page'],
◆ testAfterLogin()
ILIAS\LegalDocuments\test\ConductorTest::testAfterLogin |
( |
| ) |
|
Definition at line 239 of file ConductorTest.php.
241 $called = [
false,
false];
243 $internal = $this->mockMethod(Internal::class,
'all', [
'after-login'], [
244 function () use (&$called):
void {
247 function () use (&$called):
void {
252 $instance =
new Conductor($this->mock(Container::class), $internal, $this->mock(Routing::class));
254 $instance->afterLogin();
256 $this->assertSame([
true,
true], $called);
◆ testAgree()
ILIAS\LegalDocuments\test\ConductorTest::testAgree |
( |
string |
$gui, |
|
|
string |
$key |
|
) |
| |
agreeTypes
Definition at line 144 of file ConductorTest.php.
References ILIAS\LegalDocuments\test\ConductorTest\agreement().
146 $main_template = $this->mock(ilGlobalTemplateInterface::class);
147 $main_template->expects(self::once())->method(
'setContent')->with(
'rendered');
148 $this->
agreement(
'agree', $gui, $key, $main_template);
agreement(string $method, string $gui, string $key, ?ilGlobalTemplateInterface $main_template=null)
◆ testAgreeContent()
ILIAS\LegalDocuments\test\ConductorTest::testAgreeContent |
( |
string |
$gui, |
|
|
string |
$key |
|
) |
| |
◆ testCanUseSoapApi()
ILIAS\LegalDocuments\test\ConductorTest::testCanUseSoapApi |
( |
| ) |
|
Definition at line 222 of file ConductorTest.php.
References $container.
225 'foo' => $this->mock(Constraint::class),
226 'bar' => $this->mock(Constraint::class),
229 $container = $this->mockTree(Container::class, [
230 'refinery' => [
'in' => $this->mockMethod(InGroup::class,
'series', [array_values($constraints)], $this->mock(Transformation::class))]
233 $internal = $this->mockMethod(Internal::class,
'all', [
'use-soap-api'], $constraints);
235 $instance =
new Conductor(
$container, $internal, $this->mock(Routing::class));
236 $this->assertInstanceOf(Transformation::class, $instance->canUseSoapApi());
◆ testConstruct()
ILIAS\LegalDocuments\test\ConductorTest::testConstruct |
( |
| ) |
|
Definition at line 59 of file ConductorTest.php.
61 $this->assertInstanceOf(Conductor::class,
new Conductor($this->mock(Container::class), $this->mock(Internal::class), $this->mock(Routing::class)));
◆ testFindGotoLink()
ILIAS\LegalDocuments\test\ConductorTest::testFindGotoLink |
( |
| ) |
|
Definition at line 259 of file ConductorTest.php.
References Vendor\Package\$foo.
261 $foo = $this->mock(Target::class);
262 $internal = $this->mockMethod(Internal::class,
'all', [
'goto'], [
263 $this->mockTree(GotoLink::class, [
'name' =>
'bar']),
264 $this->mockTree(GotoLink::class, [
'name' =>
'foo',
'target' =>
$foo]),
267 $instance =
new Conductor($this->mock(Container::class), $internal, $this->mock(Routing::class));
269 $target = $instance->findGotoLink(
'foo');
270 $this->assertTrue($target->isOk());
271 $this->assertSame(
$foo, $target->value());
◆ testIntercepting()
ILIAS\LegalDocuments\test\ConductorTest::testIntercepting |
( |
| ) |
|
Definition at line 275 of file ConductorTest.php.
278 'foo' => $this->mock(Intercept::class),
279 'bar' => $this->mock(Intercept::class)
282 $internal = $this->mockMethod(Internal::class,
'all', [
'intercept'], $intercepting);
284 $instance =
new Conductor($this->mock(Container::class), $internal, $this->mock(Routing::class));
285 $this->assertSame($intercepting, $instance->intercepting());
◆ testLoginPageHTML()
ILIAS\LegalDocuments\test\ConductorTest::testLoginPageHTML |
( |
| ) |
|
Definition at line 70 of file ConductorTest.php.
References $components, $container, and $space.
73 $this->mock(Component::class),
74 $this->mock(Component::class),
77 $space = $this->mock(Content::class);
79 $container = $this->mockTree(Container::class, [
81 'renderer' => $this->mockMethod(Renderer::class,
'render', [
87 $internal = $this->mockMethod(Internal::class,
'get', [
'show-on-login-page',
'foo'], fn() =>
$components);
89 $instance =
new Conductor(
$container, $internal, $this->mock(Routing::class));
91 $this->assertSame(
'rendered', $instance->loginPageHTML(
'foo'));
◆ testLogoutText()
ILIAS\LegalDocuments\test\ConductorTest::testLogoutText |
( |
| ) |
|
Definition at line 94 of file ConductorTest.php.
References $container, and null.
96 $constraint = $this->mock(Constraint::class);
97 $component = $this->mock(Component::class);
99 $container = $this->mockTree(Container::class, [
100 'refinery' => [
'to' => [
'string' => $constraint]],
101 'http' => [
'wrapper' => [
'query' => $this->mockMethod(ArrayBasedRequestWrapper::class,
'retrieve', [
'withdraw_consent', $constraint],
'foo')]],
102 'ui' => [
'renderer' => $this->mockMethod(Renderer::class,
'render', [$component],
'rendered')],
106 $internal = $this->mock(Internal::class);
107 $internal->method(
'get')->willReturnCallback(
function ($param1, $param2) use (&$called, $component) {
108 if ($param1 ===
'logout-text' && $param2 ===
'foo') {
109 return static function () use ($component):
Component {
117 $instance =
new Conductor(
$container, $internal, $this->mock(Routing::class));
119 $logoutText = $instance->logoutText();
121 $this->assertSame(
'rendered', $logoutText);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testModifyFooter()
ILIAS\LegalDocuments\test\ConductorTest::testModifyFooter |
( |
| ) |
|
Definition at line 124 of file ConductorTest.php.
References Vendor\Package\$f, and null.
126 $footer = fn() =>
null;
128 $modify_footer =
function (
Closure $f) use ($footer) {
129 $this->assertSame($footer,
$f);
133 $instance =
new Conductor($this->mock(Container::class), $this->mockMethod(Internal::class,
'all', [
'footer'], [
136 ]), $this->mock(Routing::class));
138 $this->assertSame($footer, $instance->modifyFooter($footer));
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testProvide()
ILIAS\LegalDocuments\test\ConductorTest::testProvide |
( |
| ) |
|
Definition at line 64 of file ConductorTest.php.
66 $instance =
new Conductor($this->mock(Container::class), $this->mock(Internal::class), $this->mock(Routing::class));
67 $this->assertInstanceOf(Provide::class, $instance->provide(
'foo'));
◆ testRedirectAgreeContent()
ILIAS\LegalDocuments\test\ConductorTest::testRedirectAgreeContent |
( |
| ) |
|
Definition at line 159 of file ConductorTest.php.
References $container.
161 $this->expectExceptionMessage(
'Not available.');
162 $routing = $this->mock(Routing::class);
163 $routing->expects(self::once())->method(
'redirectToOriginalTarget');
164 $constraint = $this->mock(Constraint::class);
165 $container = $this->mockTree(Container::class, [
166 'refinery' => [
'to' => [
'string' => $constraint]],
167 'http' => [
'wrapper' => [
'query' => $this->mockMethod(ArrayBasedRequestWrapper::class,
'retrieve', [
'id', $constraint],
'foo')]],
169 $internal = $this->mock(Internal::class);
170 $internal = $this->mockMethod(Internal::class,
'get', [
'agreement-form',
'foo'],
function (
string $g,
string $cmd):
Result {
171 return new Error(
'Not available.');
173 $instance =
new Conductor(
$container, $internal, $routing);
174 $instance->agreeContent(ilLegalDocumentsAgreementGUI::class,
'foo');
◆ testSelfRegistration()
ILIAS\LegalDocuments\test\ConductorTest::testSelfRegistration |
( |
| ) |
|
Definition at line 288 of file ConductorTest.php.
290 $internal = $this->mockMethod(Internal::class,
'all', [
'self-registration'], [
291 $this->mock(SelfRegistration::class),
294 $instance =
new Conductor($this->mock(Container::class), $internal, $this->mock(Routing::class));
296 $this->assertInstanceOf(Bundle::class, $instance->selfRegistration());
◆ testUserCanReadInternalMail()
ILIAS\LegalDocuments\test\ConductorTest::testUserCanReadInternalMail |
( |
| ) |
|
Definition at line 198 of file ConductorTest.php.
References $container.
201 'foo' => $this->mock(Constraint::class),
202 'bar' => $this->mock(Constraint::class),
205 $series = $this->mock(Transformation::class);
207 $container = $this->mockTree(Container::class, [
208 'refinery' => [
'in' => $this->mockMethod(
211 [array_values($constraints)],
216 $internal = $this->mockMethod(Internal::class,
'all', [
'constrain-internal-mail'], $constraints);
218 $instance =
new Conductor(
$container, $internal, $this->mock(Routing::class));
219 $this->assertSame($series, $instance->userCanReadInternalMail());
◆ testUserManagementFields()
ILIAS\LegalDocuments\test\ConductorTest::testUserManagementFields |
( |
| ) |
|
Definition at line 299 of file ConductorTest.php.
301 $internal = $this->mockMethod(Internal::class,
'all', [
'user-management-fields'], [
302 fn() => [
'foo' =>
'bar',
'baz' =>
'hej'],
303 fn() => [
'hoo' =>
'har'],
306 $instance =
new Conductor($this->mock(Container::class), $internal, $this->mock(Routing::class));
312 ], $instance->userManagementFields($this->mock(ilObjUser::class)));
◆ testUsersWithHiddenOnlineStatus()
ILIAS\LegalDocuments\test\ConductorTest::testUsersWithHiddenOnlineStatus |
( |
| ) |
|
Definition at line 184 of file ConductorTest.php.
186 $internal = $this->mockMethod(Internal::class,
'all', [
'filter-online-users'], [
190 $instance =
new Conductor($this->mock(Container::class), $internal, $this->mock(Routing::class));
193 [1, 2, 3, 4, 7, 8, 9],
194 $instance->usersWithHiddenOnlineStatus([1, 2, 3, 4, 5, 6, 7, 8, 9])
◆ testWithdraw()
ILIAS\LegalDocuments\test\ConductorTest::testWithdraw |
( |
| ) |
|
Definition at line 177 of file ConductorTest.php.
References ILIAS\LegalDocuments\test\ConductorTest\agreement().
179 $main_template = $this->mock(ilGlobalTemplateInterface::class);
180 $main_template->expects(self::once())->method(
'setContent')->with(
'rendered');
181 $this->
agreement(
'withdraw',
'foo',
'withdraw', $main_template);
agreement(string $method, string $gui, string $key, ?ilGlobalTemplateInterface $main_template=null)
The documentation for this class was generated from the following file: