ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCopyWizardOptionsTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
7 
13 class 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 }
Unit tests for class ilCopyWizardOptions.
$c
Definition: cli.php:38
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
setGlobalVariable(string $name, $value)
if($format !==null) $name
Definition: metadata.php:247
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static _getInstance(int $a_copy_id)