ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SettingsFinishingTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
28  public function testGetAndWithShowAnswerOverview(bool $io): void
29  {
30  $settings_finishing = (new SettingsFinishing(0))->withShowAnswerOverview($io);
31 
32  $this->assertInstanceOf(SettingsFinishing::class, $settings_finishing);
33  $this->assertEquals($io, $settings_finishing->getShowAnswerOverview());
34  }
35 
36  public static function getAndWithConcludingRemarksEnabledDataProvider(): array
37  {
38  return [
39  [true],
40  [false]
41  ];
42  }
43 
47  public function testGetAndWithConcludingRemarksEnabled(bool $io): void
48  {
49  $settings_finishing = (new SettingsFinishing(0))->withConcludingRemarksEnabled($io);
50 
51  $this->assertInstanceOf(SettingsFinishing::class, $settings_finishing);
52  $this->assertEquals($io, $settings_finishing->getConcludingRemarksEnabled());
53  }
54 
58  public function testGetAndWithConcludingRemarksText(?string $io): void
59  {
60  $settings_finishing = new SettingsFinishing(
61  0,
62  false,
63  false,
64  $io
65  );
66 
67  $this->assertEquals($io, $settings_finishing->getConcludingRemarksText());
68  }
69 
70  public static function getAndWithConcludingRemarksTextDataProvider(): array
71  {
72  return [
73  [null],
74  [''],
75  ['string']
76  ];
77  }
78 
82  public function testGetAndWithConcludingRemarksPageId(?int $io): void
83  {
84  $settings_finishing = (new SettingsFinishing(0))->withConcludingRemarksPageId($io);
85 
86  $this->assertInstanceOf(SettingsFinishing::class, $settings_finishing);
87  $this->assertEquals($io, $settings_finishing->getConcludingRemarksPageId());
88  }
89 
90  public static function getAndWithConcludingRemarksPageIdDataProvider(): array
91  {
92  return [
93  [null],
94  [-1],
95  [0],
96  [1]
97  ];
98  }
99 
103  public function testGetAndWithRedirectionMode(int $io): void
104  {
105  $settings_finishing = (new SettingsFinishing(0))->withRedirectionMode($io);
106 
107  $this->assertInstanceOf(SettingsFinishing::class, $settings_finishing);
108  $this->assertEquals($io, $settings_finishing->getRedirectionMode());
109  }
110 
111  public static function getAndWithRedirectionModeDataProvider(): array
112  {
113  return [
114  [-1],
115  [0],
116  [1]
117  ];
118  }
119 
123  public function testGetAndWithRedirectionUrl(?string $io): void
124  {
125  $settings_finishing = (new SettingsFinishing(0))->withRedirectionUrl($io);
126 
127  $this->assertInstanceOf(SettingsFinishing::class, $settings_finishing);
128  $this->assertEquals($io, $settings_finishing->getRedirectionUrl());
129  }
130 
131  public static function getAndWithRedirectionUrlDataProvider(): array
132  {
133  return [
134  [null],
135  [''],
136  ['string']
137  ];
138  }
139 
143  public function testGetAndWithMailNotificationContentType(int $io): void
144  {
145  $settings_finishing = (new SettingsFinishing(0))->withMailNotificationContentType($io);
146 
147  $this->assertInstanceOf(SettingsFinishing::class, $settings_finishing);
148  $this->assertEquals($io, $settings_finishing->getMailNotificationContentType());
149  }
150 
152  {
153  return [
154  [-1],
155  [0],
156  [1]
157  ];
158  }
159 
163  public function testGetAndWithAlwaysSendMailNotification(bool $io): void
164  {
165  $settings_finishing = (new SettingsFinishing(0))->withAlwaysSendMailNotification($io);
166 
167  $this->assertInstanceOf(SettingsFinishing::class, $settings_finishing);
168  $this->assertEquals($io, $settings_finishing->getAlwaysSendMailNotification());
169  }
170 
171  public static function getAndWithAlwaysSendMailNotificationDataProvider(): array
172  {
173  return [
174  [true],
175  [false]
176  ];
177  }
178 }
testGetAndWithConcludingRemarksPageId(?int $io)
getAndWithConcludingRemarksPageIdDataProvider
testGetAndWithRedirectionUrl(?string $io)
getAndWithRedirectionUrlDataProvider
testGetAndWithConcludingRemarksText(?string $io)
getAndWithConcludingRemarksTextDataProvider
static getAndWithConcludingRemarksEnabledDataProvider()
testGetAndWithMailNotificationContentType(int $io)
getAndWithMailNotificationContentTypeDataProvider
static getAndWithConcludingRemarksTextDataProvider()
static getAndWithMailNotificationContentTypeDataProvider()
testGetAndWithShowAnswerOverview(bool $io)
getAndWithConcludingRemarksEnabledDataProvider
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testGetAndWithConcludingRemarksEnabled(bool $io)
getAndWithConcludingRemarksEnabledDataProvider
static getAndWithConcludingRemarksPageIdDataProvider()
testGetAndWithRedirectionMode(int $io)
getAndWithRedirectionModeDataProvider
static getAndWithAlwaysSendMailNotificationDataProvider()
testGetAndWithAlwaysSendMailNotification(bool $io)
getAndWithAlwaysSendMailNotificationDataProvider