mirror of
https://github.com/smarty-php/smarty.git
synced 2026-01-28 10:12:23 +01:00
33 lines
501 B
PHP
33 lines
501 B
PHP
<?php
|
|
|
|
/**
|
|
* Tests the ::hasVariable method
|
|
*/
|
|
class HasVariableTest extends PHPUnit_Smarty
|
|
{
|
|
public function setUp(): void
|
|
{
|
|
$this->setUpSmarty(__DIR__);
|
|
}
|
|
|
|
|
|
public function testInit()
|
|
{
|
|
$this->cleanDirs();
|
|
}
|
|
|
|
public function testSimpleTrue()
|
|
{
|
|
$this->smarty->assign('foo', 'bar');
|
|
$this->assertTrue($this->smarty->hasVariable('foo'));
|
|
}
|
|
|
|
|
|
public function testSimpleFalse()
|
|
{
|
|
$this->smarty->assign('foo', 'bar');
|
|
$this->assertFalse($this->smarty->hasVariable('foox'));
|
|
}
|
|
|
|
}
|