ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilBuddySystemBaseTestCase.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
23 
25 {
26  private ?Container $dic = null;
27 
28  protected function setUp(): void
29  {
30  global $DIC;
31 
32  parent::setUp();
33 
34  $this->dic = is_object($DIC) ? clone $DIC : $DIC;
35 
36  $DIC = new Container();
37  }
38 
39  protected function tearDown(): void
40  {
41  global $DIC;
42 
43  $DIC = $this->dic;
44 
45  parent::tearDown();
46  }
47 
48  protected function setGlobalVariable(string $name, mixed $value): void
49  {
50  global $DIC;
51 
52  $GLOBALS[$name] = $value;
53 
54  unset($DIC[$name]);
55  $DIC[$name] = static fn($c) => $GLOBALS[$name];
56  }
57 }
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setGlobalVariable(string $name, mixed $value)
$GLOBALS["DIC"]
Definition: wac.php:53
global $DIC
Definition: shib_login.php:22