ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilConditionsTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
23 
30 {
31  protected $backupGlobals = false;
32 
33  protected Container $dic;
34 
35  public function testCondition(): void
36  {
37  $condition = new ilCondition(new ilConditionTrigger(1, 2, 'drei'), 'invalid');
38  $obligatory_condition = $condition->withObligatory(true);
39  $this->assertTrue($obligatory_condition->getObligatory());
40  $this->assertFalse($condition->getObligatory());
41  }
42 
46  protected function setGlobalVariable(string $name, $value): void
47  {
48  global $DIC;
49 
50  $GLOBALS[$name] = $value;
51  unset($DIC[$name]);
52  $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
53  return $value;
54  };
55  }
56 }
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
Condition class.
$GLOBALS["DIC"]
Definition: wac.php:53
Represents a condition trigger object.
global $DIC
Definition: shib_login.php:22
Unit tests for class ilCopyWizardOptions.
setGlobalVariable(string $name, $value)