ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilCertificateBaseTestCase.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
29 abstract class ilCertificateBaseTestCase extends TestCase
30 {
31  protected function setUp(): void
32  {
33  if (!defined('ANONYMOUS_USER_ID')) {
34  define('ANONYMOUS_USER_ID', 13);
35  }
36 
37  global $DIC;
38 
39  $this->dic = is_object($DIC) ? clone $DIC : $DIC;
40 
41  $DIC = new Container();
42 
43  parent::setUp();
44  }
45 
46  protected function setGlobalVariable(string $name, $value): void
47  {
48  global $DIC;
49 
50  $GLOBALS[$name] = $value;
51 
52  unset($DIC[$name]);
53  $DIC[$name] = static function (Container $c) use ($name) {
54  return $GLOBALS[$name];
55  };
56  }
57 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
Class ilCertificateBaseTestCase.
global $DIC
Definition: feed.php:28
$GLOBALS["DIC"]
Definition: wac.php:31
setGlobalVariable(string $name, $value)