mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
Add test for boolean and null
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty PHPunit tests literals true false null
|
||||
*
|
||||
* @package PHPunit
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
|
||||
/**
|
||||
* class for {$smarty.ldelim} {$smarty.rdelim} tests
|
||||
*
|
||||
* @runTestsInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
* @backupStaticAttributes enabled
|
||||
*/
|
||||
class BooleanNullTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
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}'));
|
||||
}
|
||||
}
|
0
tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/dummy.txt
vendored
Normal file
0
tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/dummy.txt
vendored
Normal file
Reference in New Issue
Block a user