ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SettingsResultSummaryTest.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ScoreReporting;
20 
25 
27 {
28  public function testConstruct(): void
29  {
30  $settingsResultSummary = new SettingsResultSummary(0);
31  $this->assertInstanceOf(SettingsResultSummary::class, $settingsResultSummary);
32  }
33 
38  {
39  $this->assertEquals(
40  $IO,
41  (new SettingsResultSummary(0))->withScoreReporting($IO)->getScoreReporting()
42  );
43  }
44 
45  public static function getAndWithScoreReportingDataProvider(): array
46  {
47  return [
48  [ScoreReportingTypes::SCORE_REPORTING_DISABLED],
49  [ScoreReportingTypes::SCORE_REPORTING_FINISHED],
50  [ScoreReportingTypes::SCORE_REPORTING_AFTER_PASSED]
51  ];
52  }
53 
57  public function testGetAndWithReportingDate(?\DateTimeImmutable $IO): void
58  {
59  $settingsResultSummary = new SettingsResultSummary(0);
60  $settingsResultSummary = $settingsResultSummary->withReportingDate($IO);
61  $this->assertEquals($IO, $settingsResultSummary->getReportingDate());
62  }
63 
64  public static function getAndWithReportingDateDataProvider(): array
65  {
66  return [
67  [null],
68  [new DateTimeImmutable()]
69  ];
70  }
71 
75  public function testGetAndWithShowGradingStatusEnabled(bool $IO): void
76  {
77  $settingsResultSummary = new SettingsResultSummary(0);
78  $settingsResultSummary = $settingsResultSummary->withShowGradingStatusEnabled($IO);
79  $this->assertEquals($IO, $settingsResultSummary->getShowGradingStatusEnabled());
80  }
81 
82  public static function getAndWithShowGradingStatusEnabledDataProvider(): array
83  {
84  return [
85  [false],
86  [true]
87  ];
88  }
89 
93  public function testGetAndWithShowGradingMarkEnabled(bool $IO): void
94  {
95  $settingsResultSummary = new SettingsResultSummary(0);
96  $settingsResultSummary = $settingsResultSummary->withShowGradingMarkEnabled($IO);
97  $this->assertEquals($IO, $settingsResultSummary->getShowGradingMarkEnabled());
98  }
99 
100  public static function getAndWithShowGradingMarkEnabledDataProvider(): array
101  {
102  return [
103  [false],
104  [true]
105  ];
106  }
107 
111  public function testGetAndWithPassDeletionAllowed(bool $IO): void
112  {
113  $settingsResultSummary = new SettingsResultSummary(0);
114  $settingsResultSummary = $settingsResultSummary->withPassDeletionAllowed($IO);
115  $this->assertEquals($IO, $settingsResultSummary->getPassDeletionAllowed());
116  }
117 
118  public static function getAndWithPassDeletionAllowedDataProvider(): array
119  {
120  return [
121  [false],
122  [true]
123  ];
124  }
125 
129  public function testGetAndWithShowPassDetails(bool $IO): void
130  {
131  $settingsResultSummary = new SettingsResultSummary(0);
132  $settingsResultSummary = $settingsResultSummary->withShowPassDetails($IO);
133  $this->assertEquals($IO, $settingsResultSummary->getShowPassDetails());
134  }
135 
136  public static function getAndWithShowPassDetailsDataProvider(): array
137  {
138  return [
139  [false],
140  [true]
141  ];
142  }
143 }
testGetAndWithShowPassDetails(bool $IO)
getAndWithShowPassDetailsDataProvider
testGetAndWithPassDeletionAllowed(bool $IO)
getAndWithPassDeletionAllowedDataProvider
testGetAndWithShowGradingMarkEnabled(bool $IO)
getAndWithShowGradingMarkEnabledDataProvider
testGetAndWithScoreReporting(ScoreReportingTypes $IO)
getAndWithScoreReportingDataProvider
testGetAndWithShowGradingStatusEnabled(bool $IO)
getAndWithShowGradingStatusEnabledDataProvider
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testGetAndWithReportingDate(?\DateTimeImmutable $IO)
getAndWithReportingDateDataProvider
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...