mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 01:44:26 +02:00
Add unit test
This commit is contained in:
@@ -382,6 +382,15 @@ class SecurityTest extends PHPUnit_Smarty
|
||||
$this->smarty->security_policy->trusted_uri = array();
|
||||
$this->assertContains('<title>Preface | Smarty</title>', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}'));
|
||||
}
|
||||
|
||||
/**
|
||||
* In security mode, accessing $smarty.template_object should be illegal.
|
||||
*/
|
||||
public function testSmartyTemplateObject() {
|
||||
$this->expectException(SmartyCompilerException::class);
|
||||
$this->smarty->display('string:{$smarty.template_object}');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class mysecuritystaticclass
|
||||
|
Reference in New Issue
Block a user