ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SettingsAccessTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
28  public function testGetAndWithStartTimeEnabled(bool $io): void
29  {
30  $settings_access = (new SettingsAccess(0))->withStartTimeEnabled($io);
31 
32  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
33  $this->assertEquals($io, $settings_access->getStartTimeEnabled());
34  }
35 
36  public static function getAndWithStartTimeEnabledDataProvider(): array
37  {
38  return [
39  [true],
40  [false]
41  ];
42  }
43 
47  public function testGetAndWithStartTime(?DateTimeImmutable $io): void
48  {
49  $settings_access = (new SettingsAccess(0))->withStartTime($io);
50 
51  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
52  $this->assertEquals($io, $settings_access->getStartTime());
53  }
54 
55  public static function getAndWithStartTimeDataProvider(): array
56  {
57  return [
58  [new DateTimeImmutable()],
59  [null]
60  ];
61  }
62 
66  public function testGetAndWithEndTimeEnabled(bool $io): void
67  {
68  $settings_access = (new SettingsAccess(0))->withEndTimeEnabled($io);
69 
70  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
71  $this->assertEquals($io, $settings_access->getEndTimeEnabled());
72  }
73 
74  public static function getAndWithEndTimeEnabledDataProvider(): array
75  {
76  return [
77  [true],
78  [false]
79  ];
80  }
81 
85  public function testGetAndWithEndTime(?DateTimeImmutable $io): void
86  {
87  $settings_access = (new SettingsAccess(0))->withEndTime($io);
88 
89  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
90  $this->assertEquals($io, $settings_access->getEndTime());
91  }
92 
93  public static function getAndWithEndTimeDataProvider(): array
94  {
95  return [
96  [new DateTimeImmutable()],
97  [null]
98  ];
99  }
100 
104  public function testGetAndWithPasswordEnabled(bool $io): void
105  {
106  $settings_access = (new SettingsAccess(0))->withPasswordEnabled($io);
107 
108  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
109  $this->assertEquals($io, $settings_access->getPasswordEnabled());
110  }
111 
112  public static function getAndWithPasswordEnabledDataProvider(): array
113  {
114  return [
115  [true],
116  [false]
117  ];
118  }
119 
123  public function testGetAndWithPassword(?string $io): void
124  {
125  $settings_access = (new SettingsAccess(0))->withPassword($io);
126 
127  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
128  $this->assertEquals($io, $settings_access->getPassword());
129  }
130 
131  public static function getAndWithPasswordDataProvider(): array
132  {
133  return [
134  [null],
135  [''],
136  ['string']
137  ];
138  }
139 
143  public function testGetAndWithFixedParticipants(bool $io): void
144  {
145  $settings_access = (new SettingsAccess(0))->withFixedParticipants($io);
146 
147  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
148  $this->assertEquals($io, $settings_access->getFixedParticipants());
149  }
150 
151  public static function getAndWithFixedParticipantsDataProvider(): array
152  {
153  return [
154  [true],
155  [false]
156  ];
157  }
158 }
static getAndWithEndTimeDataProvider()
testGetAndWithEndTime(?DateTimeImmutable $io)
getAndWithEndTimeDataProvider
testGetAndWithPasswordEnabled(bool $io)
getAndWithPasswordEnabledDataProvider
static getAndWithPasswordEnabledDataProvider()
static getAndWithEndTimeEnabledDataProvider()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getAndWithPasswordDataProvider()
static getAndWithStartTimeDataProvider()
testGetAndWithEndTimeEnabled(bool $io)
getAndWithEndTimeEnabledDataProvider
static getAndWithFixedParticipantsDataProvider()
testGetAndWithFixedParticipants(bool $io)
getAndWithFixedParticipantsDataProvider
testGetAndWithPassword(?string $io)
getAndWithPasswordDataProvider
static getAndWithStartTimeEnabledDataProvider()
testGetAndWithStartTimeEnabled(bool $io)
getAndWithStartTimeEnabledDataProvider
testGetAndWithStartTime(?DateTimeImmutable $io)
getAndWithStartTimeDataProvider