ILIAS  release_8 Revision v8.24
CategoryReferenceTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5use PHPUnit\Framework\TestCase;
6
12class CategoryReferenceTest extends TestCase
13{
14 protected function setUp(): void
15 {
17 $GLOBALS['DIC'] = $dic;
18
19 parent::setUp();
20
21 $this->setGlobalVariable(
22 "ilAccess",
23 $this->createConfiguredMock(
24 ilAccess::class,
25 [
26 "checkAccess" => true
27 ]
28 )
29 );
30 }
31
36 protected function setGlobalVariable(string $name, $value): void
37 {
38 global $DIC;
39
40 $GLOBALS[$name] = $value;
41
42 unset($DIC[$name]);
43 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
44 return $value;
45 };
46 }
47
48 protected function tearDown(): void
49 {
50 }
51
55 public function testCommands(): void
56 {
58 $this->assertIsArray($commands);
59 }
60}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Test clipboard repository.
setGlobalVariable(string $name, $value)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
static _getCommands()
get commands
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
$dic
Definition: result.php:32