Definition at line 37 of file UserSettingsTest.php.
◆ testAgreeDate()
ILIAS\TermsOfService\test\UserSettingsTest::testAgreeDate |
( |
| ) |
|
Definition at line 73 of file UserSettingsTest.php.
References ILIAS\UI\examples\Layout\Page\Standard\$refinery, and ILIAS\$setting.
78 $by_trying = $this->mock(ByTrying::class);
80 [
'agree date', $return_date],
81 [$date,
'another date']
83 $by_trying->expects(self::exactly(2))
86 function ($in) use (&$consecutive) {
87 [$expected, $ret] = array_shift($consecutive);
88 $this->assertEquals($expected, $in);
93 $user = $this->mock(ilObjUser::class);
94 $user->expects(self::once())->method(
'getAgreeDate')->willReturn(
'agree date');
95 $user->expects(self::once())->method(
'setAgreeDate')->with(
'another date');
96 $user->expects(self::once())->method(
'update');
98 $refinery = $this->mockTree(Refinery::class, [
'byTrying' => $by_trying]);
100 $instance =
new UserSettings(
102 $this->mock(SelectSetting::class),
107 $this->assertSame($return_date,
$setting->value());
◆ testConstruct()
ILIAS\TermsOfService\test\UserSettingsTest::testConstruct |
( |
| ) |
|
Definition at line 41 of file UserSettingsTest.php.
43 $this->assertInstanceOf(UserSettings::class,
new UserSettings(
44 $this->mock(ilObjUser::class),
45 $this->mock(SelectSetting::class),
46 $this->mock(Refinery::class)
◆ testWithdrawalRequested()
ILIAS\TermsOfService\test\UserSettingsTest::testWithdrawalRequested |
( |
| ) |
|
Definition at line 50 of file UserSettingsTest.php.
References ILIAS\$setting.
52 $setting = $this->mock(Setting::class);
53 $convert = $this->mock(Convert::class);
55 $marshal = $this->mockMethod(Marshal::class,
'boolean', [], $convert);
57 $settings = $this->mock(SelectSetting::class);
58 $settings->expects(self::once())->method(
'typed')->willReturnCallback(
function (
string $key, callable $select) use ($marshal, $convert,
$setting) {
59 $this->assertSame(
'consent_withdrawal_requested', $key);
60 $this->assertSame($convert, $select($marshal));
64 $instance =
new UserSettings(
65 $this->mock(ilObjUser::class),
67 $this->mock(Refinery::class)
70 $this->assertSame(
$setting, $instance->withdrawalRequested());
The documentation for this class was generated from the following file: