mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
3.1.15
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.14"
|
||||
"smarty/smarty-phpunit": "3.1.15"
|
||||
}
|
||||
|
||||
Replace 3.1.14 with the installed Smarty version number.
|
||||
Replace 3.1.15 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.
|
||||
|
@@ -332,8 +332,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template ".\templates\025_parent.tpl"
|
||||
* @expectedExceptionMessage {$smarty.block.child} used out of context
|
||||
* @expectedExceptionMessage Syntax error in template ".\templates\025_parent.tpl"
|
||||
* @expectedExceptionMessage tag {$smarty.block.child} used outside {block} tags
|
||||
* test {$this->smarty.block.child} outside {block]
|
||||
*/
|
||||
public function testSmartyBlockChildOutsideBlock_025()
|
||||
@@ -343,8 +343,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template ".\templates\026_parent.tpl"
|
||||
* @expectedExceptionMessage $smarty.block is invalid
|
||||
* @expectedExceptionMessage Syntax error in template ".\templates\026_parent.tpl"
|
||||
* @expectedExceptionMessage tag {$smarty.block.parent} used outside {block} tags
|
||||
* test {$this->smarty.block.parent} outside {block]
|
||||
*/
|
||||
public function testSmartyBlockParentOutsideBlock_026()
|
||||
@@ -354,8 +354,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template ".\templates\027_parent.tpl"
|
||||
* @expectedExceptionMessage $smarty.block is invalid
|
||||
* @expectedExceptionMessage Syntax error in template ".\templates\027_parent.tpl"
|
||||
* @expectedExceptionMessage illegal {$smarty.block.parent} in parent template
|
||||
* test {$this->smarty.block.parent} in parent template
|
||||
*/
|
||||
public function testSmartyBlockParentInParent_027()
|
||||
|
@@ -848,7 +848,30 @@ class PluginFunctionHtmlSelectTimeTest extends PHPUnit_Smarty
|
||||
$tpl = $this->smarty->createTemplate('eval:{html_select_time time=' . $this->now . ' use_24_hours=false display_meridian=false}');
|
||||
$this->assertEquals(str_replace("\r", '', $result), $this->smarty->fetch($tpl));
|
||||
}
|
||||
|
||||
public function testMeridian3()
|
||||
{
|
||||
$n = "\n";
|
||||
$time = mktime(0, 15, 11, 2, 20, 2011);
|
||||
$result = '<select name="Time_Hour">' . $n . '<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12" selected="selected">12</option>
|
||||
</select>
|
||||
<select name="Time_Meridian">
|
||||
<option value="am">AM</option>
|
||||
<option value="pm">PM</option>
|
||||
</select>';
|
||||
$tpl = $this->smarty->createTemplate('eval:{html_select_time time=' . $time . ' use_24_hours=false display_minutes=false display_seconds=false}');
|
||||
$this->assertEquals(str_replace("\r", '', $result), $this->smarty->fetch($tpl));
|
||||
}
|
||||
public function testMeridian4()
|
||||
{
|
||||
$n = "\n";
|
||||
|
@@ -26,8 +26,8 @@ class AttributeTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template "b8ecd121bbbc031241b1116a9db691a759eceadf"
|
||||
* @expectedExceptionMessage missing "var" attribute
|
||||
* @expectedExceptionMessage Syntax error in template "b8ecd121bbbc031241b1116a9db691a759eceadf"
|
||||
* @expectedExceptionMessage missing "var" attribute
|
||||
* test required attribute
|
||||
*/
|
||||
public function testRequiredAttributeVar()
|
||||
@@ -37,8 +37,8 @@ class AttributeTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template "46d3649920e0043f055702ef3ceef0ecdc44b892"
|
||||
* @expectedExceptionMessage unexpected "bar" attribute
|
||||
* @expectedExceptionMessage Syntax error in template "46d3649920e0043f055702ef3ceef0ecdc44b892"
|
||||
* @expectedExceptionMessage unexpected "bar" attribute
|
||||
* test unexpected attribute
|
||||
*/
|
||||
public function testUnexpectedAttribute()
|
||||
@@ -48,8 +48,8 @@ class AttributeTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template "d6c824b50e89d8fe12b393ae8ab68daeb7b6c240"
|
||||
* @expectedExceptionMessage illegal value of option flag "nocache"
|
||||
* @expectedExceptionMessage Syntax error in template "d6c824b50e89d8fe12b393ae8ab68daeb7b6c240"
|
||||
* @expectedExceptionMessage illegal value of option flag "nocache"
|
||||
* test illegal option value
|
||||
*/
|
||||
public function testIllegalOptionValue()
|
||||
@@ -59,7 +59,7 @@ class AttributeTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template "a119616ffa139e7b1145b1cd36adbff7bc9be7cf"
|
||||
* @expectedExceptionMessage Syntax error in template "a119616ffa139e7b1145b1cd36adbff7bc9be7cf"
|
||||
* @expectedExceptionMessage too many shorthand attributes
|
||||
* test too many shorthands
|
||||
*/
|
||||
|
@@ -35,8 +35,8 @@ class CompileErrorTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template "2510bcd51cbc69725f2c3d3484b2c70c00ddaeba"
|
||||
* @expectedExceptionMessage unknown tag "unknown"
|
||||
* @expectedExceptionMessage Syntax error in template "2510bcd51cbc69725f2c3d3484b2c70c00ddaeba"
|
||||
* @expectedExceptionMessage unknown tag "unknown"
|
||||
* test unkown tag error
|
||||
*/
|
||||
public function testUnknownTagError()
|
||||
@@ -56,8 +56,8 @@ class CompileErrorTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template "599a9cf0e3623a3206bd02a0f5c151d5f5f3f69e"
|
||||
* @expectedExceptionMessage Unexpected "}"
|
||||
* @expectedExceptionMessage Syntax error in template "599a9cf0e3623a3206bd02a0f5c151d5f5f3f69e"
|
||||
* @expectedExceptionMessage Unexpected "}"
|
||||
* test syntax error
|
||||
*/
|
||||
public function testSyntaxError()
|
||||
|
@@ -166,8 +166,8 @@ class ModifierTest extends PHPUnit_Smarty
|
||||
|
||||
/**
|
||||
* @expectedException SmartyCompilerException
|
||||
* @expectedExceptionMessage Syntax Error in template "4d2e368c483a648d14bbd59592da92aff3b96a2f"
|
||||
* @expectedExceptionMessage unknown modifier "unknown"
|
||||
* @expectedExceptionMessage Syntax error in template "4d2e368c483a648d14bbd59592da92aff3b96a2f"
|
||||
* @expectedExceptionMessage unknown modifier "unknown"
|
||||
* test unknown modifier error
|
||||
*/
|
||||
public function testUnknownModifier()
|
||||
|
@@ -131,6 +131,19 @@ class FilterTest extends PHPUnit_Smarty
|
||||
$tpl->assign('foo', '<?php ?>');
|
||||
$this->assertEquals('<?php ?>', $this->smarty->fetch($tpl));
|
||||
}
|
||||
|
||||
/**
|
||||
* test registered post filter
|
||||
*/
|
||||
public function testRegisteredVariableFilter2()
|
||||
{
|
||||
$var = new VarFilter();
|
||||
|
||||
$this->smarty->registerFilter(Smarty::FILTER_VARIABLE, array($var, 'variablefilter'));
|
||||
$tpl = $this->smarty->createTemplate('string:{$foo}');
|
||||
$tpl->assign('foo', 'bar');
|
||||
$this->assertEquals('var{$foo}bar', $this->smarty->fetch($tpl));
|
||||
}
|
||||
}
|
||||
|
||||
Class VarFilter
|
||||
|
Reference in New Issue
Block a user