Definition at line 36 of file SelfRegistrationTest.php.
◆ testConstruct()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistrationTest::testConstruct |
( |
| ) |
|
Definition at line 40 of file SelfRegistrationTest.php.
42 $this->assertInstanceOf(SelfRegistration::class,
new SelfRegistration(
44 $this->mock(UI::class),
45 $this->mock(User::class),
46 $this->mock(Provide::class),
◆ testLegacyInputGUIs()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistrationTest::testLegacyInputGUIs |
( |
| ) |
|
Definition at line 52 of file SelfRegistrationTest.php.
54 $instance =
new SelfRegistration(
56 $this->mock(UI::class),
57 $this->mockTree(User::class, [
'matchingDocument' =>
new Ok($this->mock(Document::class))]),
58 $this->mock(Provide::class),
64 $guis = $instance->legacyInputGUIs();
65 $this->assertSame(3, count($guis));
◆ testSaveLegacyForm()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistrationTest::testSaveLegacyForm |
( |
| ) |
|
Definition at line 68 of file SelfRegistrationTest.php.
70 $instance =
new SelfRegistration(
72 $this->mock(UI::class),
73 $this->mockTree(User::class, [
'matchingDocument' =>
new Ok($this->mock(Document::class))]),
74 $this->mock(Provide::class),
80 $this->assertTrue($instance->saveLegacyForm($this->mockTree(ilPropertyFormGUI::class, [
'getInput' =>
true])));
◆ testSaveLegacyFormFailed()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistrationTest::testSaveLegacyFormFailed |
( |
| ) |
|
Definition at line 83 of file SelfRegistrationTest.php.
85 $instance =
new SelfRegistration(
87 $this->mock(UI::class),
88 $this->mockTree(User::class, [
'matchingDocument' =>
new Ok($this->mock(Document::class))]),
89 $this->mock(Provide::class),
95 $checkbox = $this->mock(ilCheckboxInputGUI::class);
96 $checkbox->expects(self::once())->method(
'setAlert');
98 $form = $this->mockTree(ilPropertyFormGUI::class, [
'getInput' =>
false]);
99 $form->expects(self::once())->method(
'getItemByPostVar')->with(
'accept_foo')->willReturn($checkbox);
101 $this->assertFalse($instance->saveLegacyForm($form));
◆ testUserCreation()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistrationTest::testUserCreation |
( |
| ) |
|
◆ testUserCreationFailed()
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistrationTest::testUserCreationFailed |
( |
| ) |
|
Definition at line 126 of file SelfRegistrationTest.php.
References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistration\userCreation().
128 $user = $this->mock(ilObjUser::class);
129 $ldoc_user = $this->mock(User::class);
130 $ldoc_user->expects(self::once())->method(
'acceptMatchingDocument')->willReturnCallback(
function () {
131 throw new \ILIAS\Data\NotOKException(
'This is not ok.');
134 $ldoc_user->expects(self::once())->method(
'acceptAnyDocument');
136 $instance =
new SelfRegistration(
138 $this->mock(UI::class),
139 $this->mock(User::class),
140 $this->mock(Provide::class),
142 function (
ilObjUser $u) use ($user, $ldoc_user): User {
143 $this->assertSame($user, $u);
149 $instance->userCreation($user);
The documentation for this class was generated from the following file: