29 protected function setUp(): void
31 $this->data_factory =
new Data\Factory();
51 $this->data_factory->version(
"6.5"),
57 $this->data_factory->version(
"1.0.0"),
59 $this->data_factory->version(
"1.0.0"),
60 $this->data_factory->version(
"6.0"),
61 $this->data_factory->version(
"6.99"),
63 "richard.klees@concepts-and-training.de",
72 $this->assertEquals($this->pluginslot, $this->plugin->getPluginSlot());
73 $this->assertEquals($this->component, $this->plugin->getComponent());
74 $this->assertEquals(
"plg1", $this->plugin->getId());
75 $this->assertEquals(
"Plugin1", $this->plugin->getName());
76 $this->assertEquals(
"Type1", $this->plugin->getType());
77 $this->assertTrue($this->plugin->isActivated());
78 $this->assertEquals($this->data_factory->version(
"1.0.0"), $this->plugin->getCurrentVersion());
79 $this->assertEquals(12, $this->plugin->getCurrentDBVersion());
80 $this->assertEquals($this->data_factory->version(
"1.0.0"), $this->plugin->getAvailableVersion());
81 $this->assertEquals($this->data_factory->version(
"6.0"), $this->plugin->getMinimumILIASVersion());
82 $this->assertEquals($this->data_factory->version(
"6.99"), $this->plugin->getMaximumILIASVersion());
83 $this->assertEquals(
"Richard Klees", $this->plugin->getResponsible());
84 $this->assertEquals(
"richard.klees@concepts-and-training.de", $this->plugin->getResponsibleMail());
85 $this->assertTrue($this->plugin->supportsLearningProgress());
86 $this->assertFalse($this->plugin->supportsExport());
87 $this->assertTrue($this->plugin->supportsCLISetup());
92 $this->assertTrue($this->plugin->isInstalled());
98 $this->data_factory->version(
"6.5"),
106 $this->data_factory->version(
"1.0.0"),
107 $this->data_factory->version(
"6.0"),
108 $this->data_factory->version(
"6.99"),
110 "richard.klees@concepts-and-training.de",
116 $this->assertFalse($this->plugin->isInstalled());
121 $this->assertFalse($this->plugin->isUpdateRequired());
127 $this->data_factory->version(
"6.5"),
135 $this->data_factory->version(
"1.0.0"),
136 $this->data_factory->version(
"6.0"),
137 $this->data_factory->version(
"6.99"),
139 "richard.klees@concepts-and-training.de",
145 $this->assertFalse($this->plugin->isUpdateRequired());
151 $this->data_factory->version(
"6.5"),
157 $this->data_factory->version(
"2.0.0"),
159 $this->data_factory->version(
"1.0.0"),
160 $this->data_factory->version(
"6.0"),
161 $this->data_factory->version(
"6.99"),
163 "richard.klees@concepts-and-training.de",
169 $this->assertTrue($this->plugin->isUpdateRequired());
174 $this->assertFalse($this->plugin->isVersionToOld());
177 $this->data_factory->version(
"6.5"),
183 $this->data_factory->version(
"1.0.0"),
185 $this->data_factory->version(
"2.0.0"),
186 $this->data_factory->version(
"6.0"),
187 $this->data_factory->version(
"6.99"),
189 "richard.klees@concepts-and-training.de",
194 $this->assertFalse($plugin->isVersionToOld());
197 $this->data_factory->version(
"6.5"),
203 $this->data_factory->version(
"1.2.2"),
205 $this->data_factory->version(
"1.0.0"),
206 $this->data_factory->version(
"6.0"),
207 $this->data_factory->version(
"6.99"),
209 "richard.klees@concepts-and-training.de",
214 $this->assertTrue($plugin->isVersionToOld());
217 #[\PHPUnit\Framework\Attributes\DataProvider('versionCompliance')] 227 $this->data_factory->version(
"1.2.2"),
229 $this->data_factory->version(
"1.0.0"),
230 $this->data_factory->version(
"6.0"),
231 $this->data_factory->version(
"6.99"),
233 "richard.klees@concepts-and-training.de",
243 $data_factory =
new Data\Factory();
245 [$data_factory->version(
"5.4"),
false],
246 [$data_factory->version(
"6.5"),
true],
247 [$data_factory->version(
"7.1"),
false]
255 $this->plugin->getPath()
263 $this->plugin->getClassName()
270 "ilPlugin1ConfigGUI",
271 $this->plugin->getConfigGUIClassName()
275 #[\PHPUnit\Framework\Attributes\DataProvider('isActivationPossibleTruthTable')] 278 bool $supports_current_ilias,
280 bool $is_version_to_old,
281 bool $is_activation_possible
283 $plugin =
new class ($is_installed, $supports_current_ilias, $needs_update, $is_version_to_old) extends
ilPluginInfo {
284 protected bool $is_installed;
285 protected bool $supports_current_ilias;
286 protected bool $needs_update;
287 protected bool $is_version_to_old;
291 bool $supports_current_ilias,
293 bool $is_version_to_old
295 $this->is_installed = $is_installed;
296 $this->supports_current_ilias = $supports_current_ilias;
297 $this->needs_update = $needs_update;
298 $this->is_version_to_old = $is_version_to_old;
301 public function isInstalled():
bool 303 return $this->is_installed;
306 public function isUpdateRequired():
bool 308 return $this->needs_update;
311 public function isCompliantToILIAS():
bool 313 return $this->supports_current_ilias;
316 public function isVersionToOld():
bool 318 return $this->is_version_to_old;
329 [
false,
false,
false,
false,
false],
330 [
false,
false,
true,
false,
false],
331 [
false,
true,
false,
false,
false],
332 [
false,
true,
true,
false,
false],
333 [
true,
false,
false,
false,
false],
334 [
true,
false,
true,
false,
false],
335 [
true,
true,
false,
false,
true],
336 [
true,
true,
true,
true,
false],
337 [
false,
false,
false,
true,
false],
338 [
false,
false,
true,
true,
false],
339 [
false,
true,
false,
true,
false],
340 [
false,
true,
true,
true,
false],
341 [
true,
false,
false,
true,
false],
342 [
true,
false,
true,
true,
false],
343 [
true,
true,
false,
true,
false],
344 [
true,
true,
true,
true,
false]
348 #[\PHPUnit\Framework\Attributes\DataProvider('isActiveTruthTable')] 351 bool $supports_current_ilias,
354 bool $is_version_to_old,
355 bool $is_activation_possible
357 $plugin =
new class ($is_installed, $supports_current_ilias, $needs_update, $is_activated, $is_version_to_old) extends
ilPluginInfo {
358 protected bool $is_installed;
359 protected bool $supports_current_ilias;
360 protected bool $needs_update;
361 protected bool $is_activated;
362 protected bool $is_version_to_old;
366 bool $supports_current_ilias,
369 bool $is_version_to_old
371 $this->is_installed = $is_installed;
372 $this->supports_current_ilias = $supports_current_ilias;
373 $this->needs_update = $needs_update;
374 $this->is_activated = $is_activated;
375 $this->is_version_to_old = $is_version_to_old;
378 public function isActivated():
bool 380 return $this->is_activated;
383 public function isInstalled():
bool 385 return $this->is_installed;
388 public function isUpdateRequired():
bool 390 return $this->needs_update;
393 public function isCompliantToILIAS():
bool 395 return $this->supports_current_ilias;
398 public function isVersionToOld():
bool 400 return $this->is_version_to_old;
404 $this->assertEquals($is_activation_possible, $plugin->
isActive());
411 [
false,
false,
false,
false,
false,
false],
412 [
false,
false,
false,
true,
false,
false],
413 [
false,
false, true ,
false,
false,
false],
414 [
false,
false, true ,
true,
false,
false],
415 [
false,
true,
false,
false,
false,
false],
416 [
false,
true,
false,
true,
false,
false],
417 [
false,
true, true ,
false,
false,
false],
418 [
false,
true, true ,
true,
false,
false],
419 [
true,
false,
false,
false,
false,
false],
420 [
true,
false,
false,
true,
false,
false],
421 [
true,
false, true ,
false,
false,
false],
422 [
true,
false, true ,
true,
false,
false],
423 [
true,
true,
false,
false,
false,
false],
424 [
true,
true,
false,
true,
false,
true],
425 [
true,
true, true ,
false,
false,
false],
426 [
true,
true, true ,
true,
false,
false],
428 [
false,
false,
false,
false,
true,
false],
429 [
false,
false,
false,
true,
true,
false],
430 [
false,
false, true ,
false,
true,
false],
431 [
false,
false, true ,
true,
true,
false],
432 [
false,
true,
false,
false,
true,
false],
433 [
false,
true,
false,
true,
true,
false],
434 [
false,
true, true ,
false,
true,
false],
435 [
false,
true, true ,
true,
true,
false],
436 [
true,
false,
false,
false,
true,
false],
437 [
true,
false,
false,
true,
true,
false],
438 [
true,
false, true ,
false,
true,
false],
439 [
true,
false, true ,
true,
true,
false],
440 [
true,
true,
false,
false,
true,
false],
441 [
true,
true,
false,
true,
true,
false],
442 [
true,
true, true ,
false,
true,
false],
443 [
true,
true, true ,
true,
true,
false],
448 #[\PHPUnit\Framework\Attributes\DataProvider('inactivityReasonTable')] 451 bool $supports_current_ilias,
454 bool $is_version_to_old,
455 string $inactivity_reason
457 $plugin =
new class ($is_installed, $supports_current_ilias, $needs_update, $is_activated, $is_version_to_old) extends
ilPluginInfo {
458 protected bool $is_installed;
459 protected bool $supports_current_ilias;
460 protected bool $needs_update;
461 protected bool $is_activated;
462 protected bool $is_version_to_old;
466 bool $supports_current_ilias,
469 bool $is_version_to_old
471 $this->is_installed = $is_installed;
472 $this->supports_current_ilias = $supports_current_ilias;
473 $this->needs_update = $needs_update;
474 $this->is_activated = $is_activated;
475 $this->is_version_to_old = $is_version_to_old;
478 public function isActivated():
bool 480 return $this->is_activated;
483 public function isInstalled():
bool 485 return $this->is_installed;
488 public function isUpdateRequired():
bool 490 return $this->needs_update;
493 public function isCompliantToILIAS():
bool 495 return $this->supports_current_ilias;
500 return $this->current_version;
503 public function isVersionToOld():
bool 505 return $this->is_version_to_old;
514 $this->expectException(LogicException::class);
521 public function isActive():
bool 534 [
false,
false,
false,
false,
false,
"cmps_needs_matching_ilias_version"],
535 [
false,
false,
false,
true,
false,
"cmps_needs_matching_ilias_version"],
536 [
false,
false, true ,
false,
false,
"cmps_needs_matching_ilias_version"],
537 [
false,
false, true ,
true,
false,
"cmps_needs_matching_ilias_version"],
538 [
false,
true,
false,
false,
false,
"cmps_must_installed"],
539 [
false,
true,
false,
true,
false,
"cmps_must_installed"],
540 [
false,
true, true ,
false,
false,
"cmps_must_installed"],
541 [
false,
true, true ,
true,
false,
"cmps_must_installed"],
542 [
true,
false,
false,
false,
false,
"cmps_needs_matching_ilias_version"],
543 [
true,
false,
false,
true,
false,
"cmps_needs_matching_ilias_version"],
544 [
true,
false, true ,
false,
false,
"cmps_needs_matching_ilias_version"],
545 [
true,
false, true ,
true,
false,
"cmps_needs_matching_ilias_version"],
546 [
true,
true,
false,
false,
false,
"cmps_not_activated"],
547 [
true,
true, true ,
false,
false,
"cmps_needs_update"],
548 [
true,
true, true ,
true,
false,
"cmps_needs_update"],
549 [
false,
false,
false,
false,
true,
"cmps_needs_matching_ilias_version"],
550 [
false,
false,
false,
true,
true,
"cmps_needs_matching_ilias_version"],
551 [
false,
false, true ,
false,
true,
"cmps_needs_matching_ilias_version"],
552 [
false,
false, true ,
true,
true,
"cmps_needs_matching_ilias_version"],
553 [
false,
true,
false,
false,
true,
"cmps_must_installed"],
554 [
false,
true,
false,
true,
true,
"cmps_must_installed"],
555 [
false,
true, true ,
false,
true,
"cmps_must_installed"],
556 [
false,
true, true ,
true,
true,
"cmps_must_installed"],
557 [
true,
false,
false,
false,
true,
"cmps_needs_matching_ilias_version"],
558 [
true,
false,
false,
true,
true,
"cmps_needs_matching_ilias_version"],
559 [
true,
false, true ,
false,
true,
"cmps_needs_matching_ilias_version"],
560 [
true,
false, true ,
true,
true,
"cmps_needs_matching_ilias_version"],
561 [
true,
true,
false,
false,
true,
"cmps_needs_upgrade"],
562 [
true,
true, true ,
false,
true,
"cmps_needs_upgrade"],
563 [
true,
true, true ,
true,
true,
"cmps_needs_upgrade"],
static versionCompliance()
testIsCompliantToILIAS(Data\Version $version, bool $is_compliant)
testGetReasonForInactivityThrowsOnActivePlugin()
testIsActivationPossible(bool $is_installed, bool $supports_current_ilias, bool $needs_update, bool $is_version_to_old, bool $is_activation_possible)
testIsActive(bool $is_installed, bool $supports_current_ilias, bool $needs_update, bool $is_activated, bool $is_version_to_old, bool $is_activation_possible)
ilComponentInfo $component
Simple value class for basic information about a pluginslot.
isActive()
Is this plugin active right now?
Data Factory $data_factory
testUpdateIsNotRequired()
testUpdateIsNotRequiredNotInstalled()
static inactivityReasonTable()
testGetConfigureClassName()
static isActivationPossibleTruthTable()
isActivationPossible()
Can this plugin be activated right now.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isCompliantToILIAS()
"ILIAS Version compliance" tells if the plugin can be operated with the given ILIAS version...
Simple value class for information about a plugin.
getReasonForInactivity()
Which is the reason for the inactivity?
ilPluginSlotInfo $pluginslot
__construct(Container $dic, ilPlugin $plugin)
static isActiveTruthTable()
A version number that consists of three numbers (major, minor, patch).
Simple value class for basic information about a component.
testGetReasonForInactivity(bool $is_installed, bool $supports_current_ilias, bool $needs_update, bool $is_activated, bool $is_version_to_old, string $inactivity_reason)