ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\DataProtection\test\UserSettingsTest Class Reference
+ Inheritance diagram for ILIAS\DataProtection\test\UserSettingsTest:
+ Collaboration diagram for ILIAS\DataProtection\test\UserSettingsTest:

Public Member Functions

 testConstruct ()
 
 testWithdrawalRequested ()
 
 testAgreeDate ()
 

Detailed Description

Definition at line 33 of file UserSettingsTest.php.

Member Function Documentation

◆ testAgreeDate()

ILIAS\DataProtection\test\UserSettingsTest::testAgreeDate ( )

Definition at line 59 of file UserSettingsTest.php.

59 : void
60 {
61 $setting = $this->mock(Setting::class);
62 $convert = $this->mock(Convert::class);
63
64 $date = $this->mock(Convert::class);
65
66 $marshal = $this->mockMethod(Marshal::class, 'nullable', [$date], $convert);
67 $marshal->expects(self::once())->method('dateTime')->willReturn($date);
68
69 $settings = $this->mock(SelectSetting::class);
70 $settings->expects(self::once())->method('typed')->willReturnCallback(function (string $key, callable $select) use ($marshal, $convert, $setting) {
71 $this->assertSame('dpro_agree_date', $key);
72 $this->assertSame($convert, $select($marshal));
73 return $setting;
74 });
75
76 $this->assertSame($setting, (new UserSettings($settings))->agreeDate());
77 }
ilSetting $setting
Definition: class.ilias.php:68

References ILIAS\$setting.

◆ testConstruct()

ILIAS\DataProtection\test\UserSettingsTest::testConstruct ( )

Definition at line 37 of file UserSettingsTest.php.

37 : void
38 {
39 $this->assertInstanceOf(UserSettings::class, new UserSettings($this->mock(SelectSetting::class)));
40 }

◆ testWithdrawalRequested()

ILIAS\DataProtection\test\UserSettingsTest::testWithdrawalRequested ( )

Definition at line 42 of file UserSettingsTest.php.

42 : void
43 {
44 $setting = $this->mock(Setting::class);
45 $convert = $this->mock(Convert::class);
46
47 $marshal = $this->mockMethod(Marshal::class, 'boolean', [], $convert);
48
49 $settings = $this->mock(SelectSetting::class);
50 $settings->expects(self::once())->method('typed')->willReturnCallback(function (string $key, callable $select) use ($marshal, $convert, $setting) {
51 $this->assertSame('dpro_withdrawal_requested', $key);
52 $this->assertSame($convert, $select($marshal));
53 return $setting;
54 });
55
56 $this->assertSame($setting, (new UserSettings($settings))->withdrawalRequested());
57 }

References ILIAS\$setting.


The documentation for this class was generated from the following file: