unit tests

This commit is contained in:
Simon Wisselink
2024-03-29 22:42:28 +01:00
parent 27e5768e31
commit 91daac7d3b
4 changed files with 32 additions and 4 deletions

View File

@ -1,2 +0,0 @@
# Ignore anything in here, but keep this directory
*

View File

@ -1,2 +0,0 @@
# Ignore anything in here, but keep this directory
*

View File

@ -0,0 +1,32 @@
<?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'));
}
}