ILIAS  release_8 Revision v8.24
DIContainerTest.php
Go to the documentation of this file.
1<?php
2
3namespace ILIAS\DI;
4
5use PHPUnit\Framework\TestCase;
6
7/******************************************************************************
8 *
9 * This file is part of ILIAS, a powerful learning management system.
10 *
11 * ILIAS is licensed with the GPL-3.0, you should have received a copy
12 * of said license along with the source code.
13 *
14 * If this is not the case or you just want to try ILIAS, you'll find
15 * us at:
16 * https://www.ilias.de
17 * https://github.com/ILIAS-eLearning
18 *
19 *****************************************************************************/
23class DIContainerTest extends TestCase
24{
28 protected $DIC;
29
30 protected function setUp(): void
31 {
32 $this->DIC = new Container();
33 }
34
36 {
37 $this->assertFalse($this->DIC->isDependencyAvailable("ctrl"));
38 }
39
41 {
42 $this->DIC["ilCtrl"] = $this->getMockBuilder(\ilCtrl::class)
43 ->disableOriginalConstructor()
44 ->getMock();
45
46 $this->assertTrue($this->DIC->isDependencyAvailable("ctrl"));
47 }
48}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Class DIContainerTest.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Container.php:19