2020-04-13 15:30:52 +02:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Smarty PHPunit tests for templateExists method
|
|
|
|
|
*
|
|
|
|
|
* @package PHPunit
|
|
|
|
|
* @author Uwe Tews
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* class for templateExists tests
|
|
|
|
|
*
|
|
|
|
|
* @runTestsInSeparateProcess
|
|
|
|
|
* @preserveGlobalState disabled
|
|
|
|
|
* @backupStaticAttributes enabled
|
|
|
|
|
*/
|
|
|
|
|
class TemplateExistsTest extends PHPUnit_Smarty
|
|
|
|
|
{
|
2021-10-13 12:15:17 +02:00
|
|
|
public function setUp(): void
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
2022-09-27 13:03:34 +03:00
|
|
|
$this->setUpSmarty(__DIR__);
|
2020-04-13 15:30:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testInit()
|
|
|
|
|
{
|
|
|
|
|
$this->cleanDirs();
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* test $smarty->templateExists true
|
|
|
|
|
*/
|
|
|
|
|
public function testSmartyTemplateExists()
|
|
|
|
|
{
|
|
|
|
|
$this->assertTrue($this->smarty->templateExists('helloworld.tpl'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* test $smarty->templateExists false
|
|
|
|
|
*/
|
|
|
|
|
public function testSmartyTemplateNotExists()
|
|
|
|
|
{
|
|
|
|
|
$this->assertFalse($this->smarty->templateExists('notthere.tpl'));
|
|
|
|
|
}
|
|
|
|
|
}
|