ILIAS  release_8 Revision v8.24
ilCopyWizardOptionsTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5use PHPUnit\Framework\TestCase;
7
13class ilCopyWizardOptionsTest extends TestCase
14{
15 protected $backupGlobals = false;
16
17 protected Container $dic;
18
19 protected function setUp(): void
20 {
22 parent::setUp();
23 }
24
25 public function testSingleton(): void
26 {
29 $this->assertTrue($first === $second);
30 }
31
32
37 protected function setGlobalVariable(string $name, $value): void
38 {
39 global $DIC;
40
41 $GLOBALS[$name] = $value;
42 unset($DIC[$name]);
43 $DIC[$name] = static function (Container $c) use ($value) {
44 return $value;
45 };
46 }
47
48 protected function initCopyWizardDependencies(): void
49 {
50 $this->dic = new Container();
51 $GLOBALS['DIC'] = $this->dic;
52
53 $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
54 $this->setGlobalVariable('tree', $this->createMock(ilTree::class));
55 }
56}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Unit tests for class ilCopyWizardOptions.
setGlobalVariable(string $name, $value)
static _getInstance(int $a_copy_id)
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247