summaryrefslogtreecommitdiff
path: root/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php
blob: 047af7b90e748db45400144e630b96a31b1692bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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'));
	}

}