ILIAS  release_8 Revision v8.24
ilSystemStyleBaseFSTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once('libs/composer/vendor/autoload.php');
22
23use PHPUnit\Framework\TestCase;
24
25abstract class ilSystemStyleBaseFSTest extends TestCase
26{
31 protected ?ILIAS\DI\Container $save_dic = null;
32 protected ilLanguage $lng;
34
35 protected function setUp(): void
36 {
37 global $DIC;
38 $DIC['tpl'] = $this->getMockBuilder(ilGlobalTemplateInterface::class)->getMock();
39 $this->system_style_config = new ilSystemStyleConfigMock();
40 $this->message_stack = new ilSystemStyleMessageStack($DIC['tpl']);
41
42 if (!file_exists($this->system_style_config->test_skin_temp_path)) {
43 mkdir($this->system_style_config->test_skin_temp_path);
44 }
45 $this->lng = new ilLanguageMock();
46
47 $this->file_system = new ilFileSystemHelper($this->lng, $this->message_stack);
48 $this->file_system->recursiveCopy(
49 $this->system_style_config->test_skin_original_path,
50 $this->system_style_config->test_skin_temp_path
51 );
52
53 $factory = new ilSkinFactory($this->lng, $this->system_style_config);
54 $this->container = $factory->skinStyleContainerFromId('skin1', $this->message_stack);
55 $this->style = $this->container->getSkin()->getStyle('style1');
56 }
57
58 protected function tearDown(): void
59 {
60 $this->file_system->recursiveRemoveDir($this->system_style_config->test_skin_temp_path);
61 }
62}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
File System Helper, to reduce deps.
language handling
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
This class is responsible for all file system related actions related actions of a skin such as copyi...
ilSystemStyleConfigMock $system_style_config
ilSystemStyleMessageStack $message_stack
ilSkinStyleContainer $container
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Used to stack messages to be shown to the user.
global $DIC
Definition: feed.php:28
$factory
Definition: metadata.php:75