Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid committed Jan 24, 2021
1 parent 6463519 commit 288a54f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/UnitTests/SecurityTests/SecurityTest.php
Expand Up @@ -382,6 +382,15 @@ public function testNotTrustedUri()
$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
Expand Down

0 comments on commit 288a54f

Please sign in to comment.