Files

48 lines
1002 B
PHP
Raw Permalink Normal View History

<?php
/**
* Smarty PHPunit tests literals true false null
*
2023-08-08 00:04:14 +02:00
* @author Uwe Tews
*/
/**
* class for {$smarty.ldelim} {$smarty.rdelim} tests
*
2023-08-08 00:04:14 +02:00
*
*
*
*/
class BooleanNullTest extends PHPUnit_Smarty
{
2021-10-13 12:15:17 +02:00
public function setUp(): void
{
$this->setUpSmarty(__DIR__);
}
/**
* 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}'));
}
}