|
| setUp () |
|
| testGetTemplatePath (string $skin, string $style, bool $file_exists, string $tpl_filename, string $component, string $expected) |
| templatePathDataProvider More...
|
|
Definition at line 23 of file ilTemplateTest.php.
◆ setUp()
ilTemplateTest::setUp |
( |
| ) |
|
Definition at line 28 of file ilTemplateTest.php.
References $path, ILIAS\GlobalScreen\Provider\__construct(), and null.
30 $this->il_template =
new class () extends
ilTemplate {
31 protected string $style =
'delos';
32 protected string $skin =
'default';
33 protected bool $file_exists =
true;
37 public function _getTemplatePath(
string $a_tplname, ?
string $a_in_module =
null): string
39 return $this->getTemplatePath($a_tplname, $a_in_module);
41 protected function getCurrentStyle(): ?string
45 public function withStyle(
string $style)
48 $clone->style = $style;
51 public function withSkin(
string $skin)
57 protected function getCurrentSkin(): ?string
61 protected function fileExistsInSkin(
string $path): bool
63 return $this->file_exists;
65 public function withFileExists(
bool $file_exists)
68 $clone->file_exists = $file_exists;
72 $this->il_root = realpath(__DIR__ .
'/../../../../');
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(Container $dic, ilPlugin $plugin)
◆ templatePathDataProvider()
static ilTemplateTest::templatePathDataProvider |
( |
| ) |
|
|
static |
Definition at line 77 of file ilTemplateTest.php.
79 $il_root = realpath(__DIR__ .
'/../../../../');
81 'standard component template' => [
82 'skin' =>
'default',
'style' =>
'delos',
'file_exists' =>
true,
83 'tpl_filename' =>
'tpl.appointment_panel.html',
84 'component' =>
'components/ILIAS/Calendar',
85 'expected' =>
$il_root .
'/components/ILIAS/Calendar/templates/default/tpl.appointment_panel.html' 87 'plugin template' => [
88 'skin' =>
'default',
'style' =>
'delos',
'file_exists' =>
true,
89 'tpl_filename' =>
'tpl.test.html',
91 'component' =>
$il_root .
'/components/ILIAS/Component/classes/../../../../public/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/EditorAsMode',
92 'expected' =>
$il_root .
'/components/ILIAS/Component/classes/../../../../public/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/EditorAsMode/templates/default/tpl.test.html',
95 'skin' =>
'mySkin',
'style' =>
'myStyle',
'file_exists' =>
true,
96 'tpl_filename' =>
'tpl.external_settings.html',
97 'component' =>
'components/ILIAS/Administration',
98 'expected' =>
$il_root .
'/public/Customizing/skin/mySkin/myStyle/components/ILIAS/Administration/tpl.external_settings.html',
100 'custom skin, unaltered file' => [
101 'skin' =>
'mySkin',
'style' =>
'myStyle',
'file_exists' =>
false,
102 'tpl_filename' =>
'tpl.external_settings.html',
103 'component' =>
'components/ILIAS/Administration',
104 'expected' =>
$il_root .
'/components/ILIAS/Administration/templates/default/tpl.external_settings.html',
107 'skin' =>
'default',
'style' =>
'delos',
'file_exists' =>
true,
108 'tpl_filename' =>
'components/ILIAS/UI/src/templates/default/Input/tpl.standard.html',
110 'expected' =>
$il_root .
'/components/ILIAS/UI/src/templates/default/Input/tpl.standard.html',
112 'ui template from skin' => [
113 'skin' =>
'mySkin',
'style' =>
'myStyle',
'file_exists' =>
true,
114 'tpl_filename' =>
'components/ILIAS/UI/src/templates/default/Input/tpl.standard.html',
116 'expected' =>
$il_root .
'/public/Customizing/skin/mySkin/myStyle/UI/Input/tpl.standard.html',
118 'ui template from skin, unaltered' => [
119 'skin' =>
'mySkin',
'style' =>
'myStyle',
'file_exists' =>
false,
120 'tpl_filename' =>
'components/ILIAS/UI/src/templates/default/Input/tpl.standard.html',
122 'expected' =>
$il_root .
'/components/ILIAS/UI/src/templates/default/Input/tpl.standard.html',
124 'trailing slash' => [
125 'skin' =>
'default',
'style' =>
'delos',
'file_exists' =>
true,
126 'tpl_filename' =>
'tpl.test.html',
127 'component' =>
'components/ILIAS/Test/',
128 'expected' =>
$il_root .
'/components/ILIAS/Test/templates/default/tpl.test.html',
◆ testGetTemplatePath()
ilTemplateTest::testGetTemplatePath |
( |
string |
$skin, |
|
|
string |
$style, |
|
|
bool |
$file_exists, |
|
|
string |
$tpl_filename, |
|
|
string |
$component, |
|
|
string |
$expected |
|
) |
| |
templatePathDataProvider
Definition at line 137 of file ilTemplateTest.php.
References $path.
145 $path = $this->il_template
148 ->withFileExists($file_exists)
149 ->_getTemplatePath($tpl_filename, $component);
151 $this->assertEquals($expected,
$path);
◆ $il_root
string ilTemplateTest::$il_root |
|
protected |
◆ $il_template
The documentation for this class was generated from the following file: