ILIAS  release_8 Revision v8.24
ilExceptionTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22use PHPUnit\Framework\TestCase;
24
29class ilExceptionTest extends TestCase
30{
31 protected Container $dic;
32
33 protected function setUp(): void
34 {
35 parent::setUp();
36 }
37
38 public function testConstruct(): void
39 {
40 $exception = new ilException('My fault');
41 $this->assertInstanceOf(ilException::class, $exception);
42 $this->assertInstanceOf(Exception::class, $exception);
43 }
44
45 protected function setGlobalVariable(string $name, $value): void
46 {
47 global $DIC;
48
49 $GLOBALS[$name] = $value;
50 unset($DIC[$name]);
51 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
52 return $value;
53 };
54 }
55}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Class ilExceptionTest.
setGlobalVariable(string $name, $value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247