Unit tests for template class.
More...
Unit tests for template class.
- Author
- Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
- Version
- $Id$ @group needsInstalledILIAS
Definition at line 15 of file ilTemplateTest.php.
◆ setUp()
ilTemplateTest::setUp |
( |
| ) |
|
|
protected |
Setup.
Definition at line 20 of file ilTemplateTest.php.
20 : void
21 {
22 if (defined('ILIAS_PHPUNIT_CONTEXT')) {
23 require_once './Services/PHPUnit/classes/class.ilUnitUtil.php';
24 ilUnitUtil::performInitialisation();
25 } else {
26 chdir(dirname(__FILE__));
27 chdir('../../../');
28 }
29
30
31 include_once("./Services/Component/classes/class.ilPluginAdmin.php");
32 global $ilPluginAdmin;
33 $ilPluginAdmin = $this->getMockBuilder('ilPluginAdmin')
34 ->getMock();
35 $ilPluginAdmin->method('getActivePluginsForSlot')
36 ->willReturn(array());
37 }
◆ testilTemplateGet()
ilTemplateTest::testilTemplateGet |
( |
| ) |
|
@backupGlobals enabled
Definition at line 42 of file ilTemplateTest.php.
43 {
44 include_once("./Services/UICore/classes/class.ilTemplate.php");
45 $tpl =
new ilTemplate(
"tpl.test_template_1.html",
true,
true,
"Services/UICore/test");
46 $tpl->setVariable(
"CONTENT",
"Hello World");
47
48 $actual =
$tpl->get();
49
50
51 $expected = "<b>Hello World</b>";
52 $this->assertEquals(
53 $actual,
54 $expected,
55 "ilTemplate get() not rendered properly."
56 );
57 }
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
References $tpl.
The documentation for this class was generated from the following file: