ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\TermsOfService\test\SettingsTest Class Reference
+ Inheritance diagram for ILIAS\TermsOfService\test\SettingsTest:
+ Collaboration diagram for ILIAS\TermsOfService\test\SettingsTest:

Public Member Functions

 testConstruct ()
 
 testEnabled ()
 
 testValidateOnLogin ()
 
 testDeleteUserOnWithdrawal ()
 
 testAdminEmail ()
 
 testAuthMode ()
 
 testLastResetDate ()
 

Private Member Functions

 assertSelect (string $method, string $key, string $type)
 

Detailed Description

Definition at line 33 of file SettingsTest.php.

Member Function Documentation

◆ assertSelect()

ILIAS\TermsOfService\test\SettingsTest::assertSelect ( string  $method,
string  $key,
string  $type 
)
private

Definition at line 72 of file SettingsTest.php.

References ILIAS\$setting.

Referenced by ILIAS\TermsOfService\test\SettingsTest\testAdminEmail(), ILIAS\TermsOfService\test\SettingsTest\testAuthMode(), ILIAS\TermsOfService\test\SettingsTest\testDeleteUserOnWithdrawal(), ILIAS\TermsOfService\test\SettingsTest\testEnabled(), ILIAS\TermsOfService\test\SettingsTest\testLastResetDate(), and ILIAS\TermsOfService\test\SettingsTest\testValidateOnLogin().

72  : void
73  {
74  $setting = $this->mock(Setting::class);
75  $convert = $this->mock(Convert::class);
76 
77  $marshal = $this->mockMethod(Marshal::class, $type, [], $convert);
78 
79  $settings = $this->mock(SelectSetting::class);
80  $settings->expects(self::once())->method('typed')->willReturnCallback(function (string $k, callable $select) use ($marshal, $convert, $setting, $key) {
81  $this->assertSame($key, $k);
82  $this->assertSame($convert, $select($marshal));
83  return $setting;
84  });
85 
86  $this->assertSame($setting, (new Settings($settings))->$method());
87  }
ilSetting $setting
Definition: class.ilias.php:68
+ Here is the caller graph for this function:

◆ testAdminEmail()

ILIAS\TermsOfService\test\SettingsTest::testAdminEmail ( )

Definition at line 57 of file SettingsTest.php.

References ILIAS\TermsOfService\test\SettingsTest\assertSelect().

57  : void
58  {
59  $this->assertSelect('adminEmail', 'admin_email', 'string');
60  }
assertSelect(string $method, string $key, string $type)
+ Here is the call graph for this function:

◆ testAuthMode()

ILIAS\TermsOfService\test\SettingsTest::testAuthMode ( )

Definition at line 62 of file SettingsTest.php.

References ILIAS\TermsOfService\test\SettingsTest\assertSelect().

62  : void
63  {
64  $this->assertSelect('authMode', 'auth_mode', 'string');
65  }
assertSelect(string $method, string $key, string $type)
+ Here is the call graph for this function:

◆ testConstruct()

ILIAS\TermsOfService\test\SettingsTest::testConstruct ( )

Definition at line 37 of file SettingsTest.php.

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

◆ testDeleteUserOnWithdrawal()

ILIAS\TermsOfService\test\SettingsTest::testDeleteUserOnWithdrawal ( )

Definition at line 52 of file SettingsTest.php.

References ILIAS\TermsOfService\test\SettingsTest\assertSelect().

52  : void
53  {
54  $this->assertSelect('deleteUserOnWithdrawal', 'tos_withdrawal_usr_deletion', 'boolean');
55  }
assertSelect(string $method, string $key, string $type)
+ Here is the call graph for this function:

◆ testEnabled()

ILIAS\TermsOfService\test\SettingsTest::testEnabled ( )

Definition at line 42 of file SettingsTest.php.

References ILIAS\TermsOfService\test\SettingsTest\assertSelect().

42  : void
43  {
44  $this->assertSelect('enabled', 'tos_status', 'boolean');
45  }
assertSelect(string $method, string $key, string $type)
+ Here is the call graph for this function:

◆ testLastResetDate()

ILIAS\TermsOfService\test\SettingsTest::testLastResetDate ( )

Definition at line 67 of file SettingsTest.php.

References ILIAS\TermsOfService\test\SettingsTest\assertSelect().

67  : void
68  {
69  $this->assertSelect('lastResetDate', 'tos_last_reset', 'dateTime');
70  }
assertSelect(string $method, string $key, string $type)
+ Here is the call graph for this function:

◆ testValidateOnLogin()

ILIAS\TermsOfService\test\SettingsTest::testValidateOnLogin ( )

Definition at line 47 of file SettingsTest.php.

References ILIAS\TermsOfService\test\SettingsTest\assertSelect().

47  : void
48  {
49  $this->assertSelect('validateOnLogin', 'tos_reevaluate_on_login', 'boolean');
50  }
assertSelect(string $method, string $key, string $type)
+ Here is the call graph for this function:

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