ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CategoryReferenceTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
22
28class CategoryReferenceTest extends TestCase
29{
30 protected function setUp(): void
31 {
33 $GLOBALS['DIC'] = $dic;
34
35 parent::setUp();
36
37 $this->setGlobalVariable(
38 "ilAccess",
39 $this->createConfiguredMock(
40 ilAccess::class,
41 [
42 "checkAccess" => true
43 ]
44 )
45 );
46 }
47
52 protected function setGlobalVariable(string $name, $value): void
53 {
54 global $DIC;
55
56 $GLOBALS[$name] = $value;
57
58 unset($DIC[$name]);
59 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
60 return $value;
61 };
62 }
63
64 protected function tearDown(): void
65 {
66 }
67
71 public function testCommands(): void
72 {
74 $this->assertIsArray($commands);
75 }
76}
Test clipboard repository.
setGlobalVariable(string $name, $value)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
static _getCommands()
get commands
$c
Definition: deliver.php:25
$dic
Definition: ltiresult.php:33
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54