ILIAS  release_8 Revision v8.24
ilBuddySystemBaseTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22use PHPUnit\Framework\TestCase;
23
27class ilBuddySystemBaseTest extends TestCase
28{
29 private ?Container $dic = null;
30
31 protected function setUp(): void
32 {
33 global $DIC;
34
35 parent::setUp();
36
37 $this->dic = is_object($DIC) ? clone $DIC : $DIC;
38
39 $DIC = new Container();
40 }
41
42 protected function tearDown(): void
43 {
44 global $DIC;
45
47
48 parent::tearDown();
49 }
50
55 protected function setGlobalVariable(string $name, $value): void
56 {
57 global $DIC;
58
59 $GLOBALS[$name] = $value;
60
61 unset($DIC[$name]);
62 $DIC[$name] = static function ($c) use ($name) {
63 return $GLOBALS[$name];
64 };
65 }
66}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
setGlobalVariable(string $name, $value)
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247