mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
Modified Php tag tests to multiple php lines.
This commit is contained in:
@@ -96,8 +96,8 @@ public function testPHP_REMOVE_php()
|
|||||||
public function testPHP_QUOTE_php()
|
public function testPHP_QUOTE_php()
|
||||||
{
|
{
|
||||||
$this->smarty->setPhpHandling(Smarty::PHP_QUOTE);
|
$this->smarty->setPhpHandling(Smarty::PHP_QUOTE);
|
||||||
$content = $this->smarty->fetch("string:qa<?php echo 'hello world'; ?>qe");
|
$content = $this->smarty->fetch("string:qa<?php echo 'hello world';\necho ' multiline'; ?>qe");
|
||||||
$this->assertEquals("qa<?php echo 'hello world'; ?>qe", $content, 'qoute <?php ?>');
|
$this->assertEquals("qa<?php echo 'hello world';\necho ' multiline'; ?>qe", $content, 'qoute <?php ?>');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* test <%...%> tag
|
* test <%...%> tag
|
||||||
@@ -135,9 +135,9 @@ public function testPHP_REMOVE_php()
|
|||||||
public function testPHP_ALLOW_asp()
|
public function testPHP_ALLOW_asp()
|
||||||
{
|
{
|
||||||
$this->smartyBC->setPhpHandling(Smarty::PHP_ALLOW);
|
$this->smartyBC->setPhpHandling(Smarty::PHP_ALLOW);
|
||||||
$content = $this->smartyBC->fetch("string:aa <% echo 'hello world';%> ae");
|
$content = $this->smartyBC->fetch("string:aa <% echo 'hello world';\n echo ' multiline';%> ae");
|
||||||
if (ini_get('asp_tags')) {
|
if (ini_get('asp_tags')) {
|
||||||
$this->assertEquals('aa hello world ae', $content, 'allow <% %>');
|
$this->assertEquals('aa hello world multiline ae', $content, 'allow <% %>');
|
||||||
} else {
|
} else {
|
||||||
$this->assertEquals("aa <% echo 'hello world';%> ae", $content, 'allow asp disabled <% %>');
|
$this->assertEquals("aa <% echo 'hello world';%> ae", $content, 'allow asp disabled <% %>');
|
||||||
}
|
}
|
||||||
@@ -149,8 +149,8 @@ public function testPHP_REMOVE_php()
|
|||||||
public function testPHP_ALLOW_script()
|
public function testPHP_ALLOW_script()
|
||||||
{
|
{
|
||||||
$this->smartyBC->setPhpHandling(Smarty::PHP_ALLOW);
|
$this->smartyBC->setPhpHandling(Smarty::PHP_ALLOW);
|
||||||
$content = $this->smartyBC->fetch("string:aa <script language='php'> echo 'hello world';</script> ae");
|
$content = $this->smartyBC->fetch("string:aa <script language='php'> echo 'hello world';\n echo ' multiline';</script> ae");
|
||||||
$this->assertEquals('aa hello world ae', $content, "allow <script language='php'>");
|
$this->assertEquals('aa hello world multiline ae', $content, "allow <script language='php'>");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* test <?php...\> tag
|
* test <?php...\> tag
|
||||||
@@ -159,8 +159,8 @@ public function testPHP_REMOVE_php()
|
|||||||
public function testPHP_ALLOW_php2()
|
public function testPHP_ALLOW_php2()
|
||||||
{
|
{
|
||||||
$this->smartyBC->setPhpHandling(Smarty::PHP_ALLOW);
|
$this->smartyBC->setPhpHandling(Smarty::PHP_ALLOW);
|
||||||
$content = $this->smartyBC->fetch("string:aa <?php echo '<?php'; ?> ae");
|
$content = $this->smartyBC->fetch("string:aa <?php echo '<?php';\necho ' ?>'; ?> ae");
|
||||||
$this->assertEquals('aa <?php ae', $content);
|
$this->assertEquals('aa <?php ?> ae', $content);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* test <?php...\> tag
|
* test <?php...\> tag
|
||||||
|
Reference in New Issue
Block a user