summaryrefslogtreecommitdiff
path: root/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php
blob: b3b73e23744fa51473778b24a9f8e7ed75196739 (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
<?php
/**
 * Smarty PHPunit tests {$smarty.constant.foo}
 *

 * @author  Uwe Tews
 */

/**
 * class for {$smarty.constant.foo} tests
 *
 * 
 * 
 * 
 */
class SmartyConstantTest extends PHPUnit_Smarty
{
    public function setUp(): void
    {
        $this->setUpSmarty(__DIR__);
    }

    /**
     * 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'));
    }
 }