ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExceptionTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
23
28class ilExceptionTest extends TestCase
29{
30 protected Container $dic;
31
32 protected function setUp(): void
33 {
34 parent::setUp();
35 }
36
37 public function testConstruct(): void
38 {
39 $exception = new ilException('My fault');
40 $this->assertInstanceOf(ilException::class, $exception);
41 $this->assertInstanceOf(Exception::class, $exception);
42 }
43
44 protected function setGlobalVariable(string $name, $value): void
45 {
46 global $DIC;
47
48 $GLOBALS[$name] = $value;
49 unset($DIC[$name]);
50 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
51 return $value;
52 };
53 }
54}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Class ilExceptionTest.
setGlobalVariable(string $name, $value)
Base class for ILIAS Exception handling.
$c
Definition: deliver.php:25
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54