ILIAS  release_8 Revision v8.24
ilExportOptionsTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5use PHPUnit\Framework\TestCase;
7
12class ilExportOptionsTest extends TestCase
13{
14 protected $backupGlobals = false;
15
16 protected Container $dic;
17
18 protected function setUp(): void
19 {
20 $this->initDependencies();
21 parent::setUp();
22 }
23
24 public function testConstruct(): void
25 {
27 $this->assertNull($options);
28
29 $options = ilExportOptions::newInstance(0);
30 $this->assertTrue($options instanceof ilExportOptions);
31
32 $options_ref = ilExportOptions::getInstance();
33 $this->assertEquals($options, $options_ref);
34 }
35
36
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 (\ILIAS\DI\Container $c) use ($value) {
44 return $value;
45 };
46 }
47
48 protected function initDependencies(): void
49 {
50 $this->dic = new Container();
51 $GLOBALS['DIC'] = $this->dic;
52
53 $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
54 }
55}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Class ilExportOptionsTest.
setGlobalVariable(string $name, $value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static newInstance(int $a_export_id)
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247