mirror of
https://github.com/smarty-php/smarty.git
synced 2026-07-06 16:30:51 +02:00
29 lines
445 B
PHP
29 lines
445 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Tests the ::hasVariable method
|
||
|
|
*/
|
||
|
|
class HasVariableTest extends PHPUnit_Smarty
|
||
|
|
{
|
||
|
|
public function setUp(): void
|
||
|
|
{
|
||
|
|
$this->setUpSmarty(__DIR__);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
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'));
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|