ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSystemStyleBaseFS.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once('vendor/composer/vendor/autoload.php');
22
23use PHPUnit\Framework\TestCase;
26
27abstract class ilSystemStyleBaseFS extends TestCase
28{
32 protected ?ILIAS\DI\Container $save_dic = null;
33 protected Language $lng;
35
36 protected function setUp(): void
37 {
38 global $DIC;
39 $DIC['tpl'] = $this->getMockBuilder(ilGlobalTemplateInterface::class)->getMock();
40 $this->system_style_config = new ilSystemStyleConfigMock();
41 $this->message_stack = new ilSystemStyleMessageStack($DIC['tpl']);
42
44 $this->lng = new ilLanguageMock();
45
46
47
48 $factory = new ilSkinFactory($this->lng, $this->system_style_config);
49 $this->container = $factory->skinStyleContainerFromId('skin1', $this->message_stack);
50 $this->style = $this->container->getSkin()->getStyle('style1');
51 }
52
53 protected function getAllContentOfFolder(string $directory): string
54 {
55 $files = scandir($directory);
56 $content = "";
57
58 foreach ($files as $file) {
59 if (is_file($directory . '/' . $file)) {
60 $content .= file_get_contents($directory . '/' . $file);
61 }
62 }
63
64 return $content;
65 }
66}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
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
ilSkinStyleContainer $container
ILIAS DI Container $save_dic
ilSystemStyleMessageStack $message_stack
getAllContentOfFolder(string $directory)
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: shib_login.php:26