blob: 08002c64fd255d14873b57881be8c4d92b83e94a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
<?php
/**
* Smarty PHPunit tests {$smarty.constant.foo}
*
* @package PHPunit
* @author Uwe Tews
*/
/**
* class for {$smarty.constant.foo} tests
*
* @runTestsInSeparateProcess
* @preserveGlobalState disabled
* @backupStaticAttributes enabled
*/
class SmartyConstantTest extends PHPUnit_Smarty
{
public function setUp(): void
{
$this->setUpSmarty(__DIR__);
}
public function testInit()
{
$this->cleanDirs();
}
/**
* test {$smarty.constant.foo}
*
*/
public function testSmartyConstant() {
define('MY_CONST_VAL','MyConstant');
$this->assertEquals('MyConstant', $this->smarty->fetch('constant.tpl'));
}
/**
* test {$smarty.constant.foo}
*
*/
public function testSmartyConstantVariable() {
define('MY_CONST_VAL2','MyConstantVar');
$this->smarty->assign('foo', 'MY_CONST_VAL2');
$this->assertEquals('MyConstantVar', $this->smarty->fetch('constant_variable.tpl'));
}
}
|