mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
3.1.20
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
For installing the PHPUnit test by composer use the following:
|
||||
|
||||
"require-dev": {
|
||||
"smarty/smarty-phpunit": "3.1.18"
|
||||
"smarty/smarty-phpunit": "3.1.20"
|
||||
}
|
||||
|
||||
Replace 3.1.19 with the installed Smarty version number.
|
||||
Replace 3.1.20 with the installed Smarty version number.
|
||||
|
||||
Starting with Smarty version 3.1.22 the "require-dev" section will be added
|
||||
to the composer.json file of the Smarty distribution.
|
||||
|
@@ -51,6 +51,16 @@ public function testPHP_REMOVEphp()
|
||||
$this->assertEquals("a echo 'hello world';e", $content, 'remove <% %>');
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* test <script language='php'>...</script> tag
|
||||
* PHP_REMOVE
|
||||
*/
|
||||
public function testPHP_REMOVEscript()
|
||||
{
|
||||
$this->smarty->setPhpHandling(Smarty::PHP_REMOVE);
|
||||
$content = $this->smarty->fetch("string:a<script language='php'> echo 'hello world';</script>e");
|
||||
$this->assertEquals("a echo 'hello world';e", $content, "remove <script language='php'>");
|
||||
}
|
||||
/**
|
||||
* test <?php...\> tag
|
||||
@@ -75,6 +85,16 @@ public function testPHP_REMOVEphp()
|
||||
$content = $this->smarty->fetch("string:pa<% echo 'hello world';%>pe");
|
||||
$this->assertEquals("pa<% echo 'hello world';%>pe", $content, 'passthru <% %>');
|
||||
}
|
||||
/**
|
||||
* test <script language='php'>...</script> tag
|
||||
* PHP_PASSTHRU
|
||||
*/
|
||||
public function testPHP_PASSTHRUscript()
|
||||
{
|
||||
$this->smarty->setPhpHandling(Smarty::PHP_PASSTHRU);
|
||||
$content = $this->smarty->fetch("string:pa<script language='php'> echo 'hello world';</script>pe");
|
||||
$this->assertEquals("pa<script language=\'php\'> echo 'hello world';</script>pe", $content, "passthru <script language='php'>");
|
||||
}
|
||||
/**
|
||||
* test <?php...\> tag
|
||||
* PHP_QUOTE
|
||||
@@ -98,6 +118,16 @@ public function testPHP_REMOVEphp()
|
||||
$content = $this->smarty->fetch("string:qa<% echo 'hello world';%>qe");
|
||||
$this->assertEquals("qa<% echo 'hello world';%>qe", $content, 'qoute <% %>');
|
||||
}
|
||||
/**
|
||||
* test <script language='php'>...</script> tag
|
||||
* PHP_QUOTE
|
||||
*/
|
||||
public function testPHP_QUOTEscript()
|
||||
{
|
||||
$this->smarty->setPhpHandling(Smarty::PHP_QUOTE);
|
||||
$content = $this->smarty->fetch("string:qa<script language='php'> echo 'hello world';</script>qe");
|
||||
$this->assertEquals("qa<script language='php'> echo 'hello world';</script>qe", $content, "quote <script language='php'>");
|
||||
}
|
||||
/**
|
||||
* test <?php...\> tag
|
||||
* PHP_ALLOW
|
||||
@@ -120,6 +150,16 @@ public function testPHP_REMOVEphp()
|
||||
$content = $this->smartyBC->fetch("string:aa <% echo 'hello world';%> ae");
|
||||
$this->assertEquals('aa hello world ae', $content, 'allow <% %>');
|
||||
}
|
||||
/**
|
||||
* test <script language='php'>...</script> tag
|
||||
* PHP_ALLOW
|
||||
*/
|
||||
public function testPHP_ALLOWscript()
|
||||
{
|
||||
$this->smartyBC->setPhpHandling(Smarty::PHP_ALLOW);
|
||||
$content = $this->smartyBC->fetch("string:aa <script language='php'> echo 'hello world';</script> ae");
|
||||
$this->assertEquals('aa hello world ae', $content, "allow <script language='php'>");
|
||||
}
|
||||
/**
|
||||
* test <?php...\> tag
|
||||
* PHP_ALLOW
|
||||
|
Reference in New Issue
Block a user