blob: 41b5a10c46cb73be9ed13c75b3f00ec8bfbbea98 (
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
46
47
48
49
50
51
|
<?php
/**
* Smarty PHPunit tests literals true false null
*
* @author Uwe Tews
*/
/**
* class for {$smarty.ldelim} {$smarty.rdelim} tests
*
*
*
*
*/
class BooleanNullTest extends PHPUnit_Smarty
{
public function setUp(): void
{
$this->setUpSmarty(__DIR__);
}
public function testInit()
{
$this->cleanDirs();
}
/**
* test true
*
*/
public function testTrue() {
$this->smarty->assign('value', true);
$this->assertEquals('true', $this->smarty->fetch('eval:{if $value === true}true{else}false{/if}'));
}
/**
* test false
*
*/
public function testFalse() {
$this->smarty->assign('value', false);
$this->assertEquals('true', $this->smarty->fetch('eval:{if $value === false}true{else}false{/if}'));
}
/**
* test null
*
*/
public function testNull() {
$this->smarty->assign('value', null);
$this->assertEquals('true', $this->smarty->fetch('eval:{if $value === null}true{else}false{/if}'));
}
}
|