ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
SettingsAccessTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithStartTimeEnabledDataProvider')]
26  public function testGetAndWithStartTimeEnabled(bool $io): void
27  {
28  $settings_access = (new SettingsAccess(0))->withStartTimeEnabled($io);
29 
30  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
31  $this->assertEquals($io, $settings_access->getStartTimeEnabled());
32  }
33 
34  public static function getAndWithStartTimeEnabledDataProvider(): array
35  {
36  return [
37  [true],
38  [false]
39  ];
40  }
41 
42  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithStartTimeDataProvider')]
43  public function testGetAndWithStartTime(?DateTimeImmutable $io): void
44  {
45  $settings_access = (new SettingsAccess(0))->withStartTime($io);
46 
47  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
48  $this->assertEquals($io, $settings_access->getStartTime());
49  }
50 
51  public static function getAndWithStartTimeDataProvider(): array
52  {
53  return [
54  [new DateTimeImmutable()],
55  [null]
56  ];
57  }
58 
59  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithEndTimeEnabledDataProvider')]
60  public function testGetAndWithEndTimeEnabled(bool $io): void
61  {
62  $settings_access = (new SettingsAccess(0))->withEndTimeEnabled($io);
63 
64  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
65  $this->assertEquals($io, $settings_access->getEndTimeEnabled());
66  }
67 
68  public static function getAndWithEndTimeEnabledDataProvider(): array
69  {
70  return [
71  [true],
72  [false]
73  ];
74  }
75 
76  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithEndTimeDataProvider')]
77  public function testGetAndWithEndTime(?DateTimeImmutable $io): void
78  {
79  $settings_access = (new SettingsAccess(0))->withEndTime($io);
80 
81  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
82  $this->assertEquals($io, $settings_access->getEndTime());
83  }
84 
85  public static function getAndWithEndTimeDataProvider(): array
86  {
87  return [
88  [new DateTimeImmutable()],
89  [null]
90  ];
91  }
92 
93  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithPasswordEnabledDataProvider')]
94  public function testGetAndWithPasswordEnabled(bool $io): void
95  {
96  $settings_access = (new SettingsAccess(0))->withPasswordEnabled($io);
97 
98  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
99  $this->assertEquals($io, $settings_access->getPasswordEnabled());
100  }
101 
102  public static function getAndWithPasswordEnabledDataProvider(): array
103  {
104  return [
105  [true],
106  [false]
107  ];
108  }
109 
110  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithPasswordDataProvider')]
111  public function testGetAndWithPassword(?string $io): void
112  {
113  $settings_access = (new SettingsAccess(0))->withPassword($io);
114 
115  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
116  $this->assertEquals($io, $settings_access->getPassword());
117  }
118 
119  public static function getAndWithPasswordDataProvider(): array
120  {
121  return [
122  [null],
123  [''],
124  ['string']
125  ];
126  }
127 
128  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithFixedParticipantsDataProvider')]
129  public function testGetAndWithFixedParticipants(bool $io): void
130  {
131  $settings_access = (new SettingsAccess(0))->withFixedParticipants($io);
132 
133  $this->assertInstanceOf(SettingsAccess::class, $settings_access);
134  $this->assertEquals($io, $settings_access->getFixedParticipants());
135  }
136 
137  public static function getAndWithFixedParticipantsDataProvider(): array
138  {
139  return [
140  [true],
141  [false]
142  ];
143  }
144 }
static getAndWithEndTimeDataProvider()
testGetAndWithEndTime(?DateTimeImmutable $io)
testGetAndWithPasswordEnabled(bool $io)
static getAndWithPasswordEnabledDataProvider()
static getAndWithEndTimeEnabledDataProvider()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getAndWithPasswordDataProvider()
static getAndWithStartTimeDataProvider()
testGetAndWithEndTimeEnabled(bool $io)
static getAndWithFixedParticipantsDataProvider()
testGetAndWithFixedParticipants(bool $io)
testGetAndWithPassword(?string $io)
static getAndWithStartTimeEnabledDataProvider()
testGetAndWithStartTimeEnabled(bool $io)
testGetAndWithStartTime(?DateTimeImmutable $io)