Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit c11a51e

Browse files
committed
3.1.15
1 parent 3a42a93 commit c11a51e

File tree

7 files changed

+58
-22
lines changed

7 files changed

+58
-22
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
For installing the PHPUnit test by composer use the following:
55

66
"require-dev": {
7-
"smarty/smarty-phpunit": "3.1.14"
7+
"smarty/smarty-phpunit": "3.1.15"
88
}
99

10-
Replace 3.1.14 with the installed Smarty version number.
10+
Replace 3.1.15 with the installed Smarty version number.
1111

1212
Starting with Smarty version 3.1.22 the "require-dev" section will be added
1313
to the composer.json file of the Smarty distribution.

UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ public function testNotExistingChildBlock_024()
332332

333333
/**
334334
* @expectedException SmartyCompilerException
335-
* @expectedExceptionMessage Syntax Error in template ".\templates\025_parent.tpl"
336-
* @expectedExceptionMessage {$smarty.block.child} used out of context
335+
* @expectedExceptionMessage Syntax error in template ".\templates\025_parent.tpl"
336+
* @expectedExceptionMessage tag {$smarty.block.child} used outside {block} tags
337337
* test {$this->smarty.block.child} outside {block]
338338
*/
339339
public function testSmartyBlockChildOutsideBlock_025()
@@ -343,8 +343,8 @@ public function testSmartyBlockChildOutsideBlock_025()
343343

344344
/**
345345
* @expectedException SmartyCompilerException
346-
* @expectedExceptionMessage Syntax Error in template ".\templates\026_parent.tpl"
347-
* @expectedExceptionMessage $smarty.block is invalid
346+
* @expectedExceptionMessage Syntax error in template ".\templates\026_parent.tpl"
347+
* @expectedExceptionMessage tag {$smarty.block.parent} used outside {block} tags
348348
* test {$this->smarty.block.parent} outside {block]
349349
*/
350350
public function testSmartyBlockParentOutsideBlock_026()
@@ -354,8 +354,8 @@ public function testSmartyBlockParentOutsideBlock_026()
354354

355355
/**
356356
* @expectedException SmartyCompilerException
357-
* @expectedExceptionMessage Syntax Error in template ".\templates\027_parent.tpl"
358-
* @expectedExceptionMessage $smarty.block is invalid
357+
* @expectedExceptionMessage Syntax error in template ".\templates\027_parent.tpl"
358+
* @expectedExceptionMessage illegal {$smarty.block.parent} in parent template
359359
* test {$this->smarty.block.parent} in parent template
360360
*/
361361
public function testSmartyBlockParentInParent_027()

UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectTimeTest.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,30 @@ public function testMeridian2()
848848
$tpl = $this->smarty->createTemplate('eval:{html_select_time time=' . $this->now . ' use_24_hours=false display_meridian=false}');
849849
$this->assertEquals(str_replace("\r", '', $result), $this->smarty->fetch($tpl));
850850
}
851-
851+
public function testMeridian3()
852+
{
853+
$n = "\n";
854+
$time = mktime(0, 15, 11, 2, 20, 2011);
855+
$result = '<select name="Time_Hour">' . $n . '<option value="01">01</option>
856+
<option value="02">02</option>
857+
<option value="03">03</option>
858+
<option value="04">04</option>
859+
<option value="05">05</option>
860+
<option value="06">06</option>
861+
<option value="07">07</option>
862+
<option value="08">08</option>
863+
<option value="09">09</option>
864+
<option value="10">10</option>
865+
<option value="11">11</option>
866+
<option value="12" selected="selected">12</option>
867+
</select>
868+
<select name="Time_Meridian">
869+
<option value="am">AM</option>
870+
<option value="pm">PM</option>
871+
</select>';
872+
$tpl = $this->smarty->createTemplate('eval:{html_select_time time=' . $time . ' use_24_hours=false display_minutes=false display_seconds=false}');
873+
$this->assertEquals(str_replace("\r", '', $result), $this->smarty->fetch($tpl));
874+
}
852875
public function testMeridian4()
853876
{
854877
$n = "\n";

UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function testInit()
2626

2727
/**
2828
* @expectedException SmartyCompilerException
29-
* @expectedExceptionMessage Syntax Error in template &quot;b8ecd121bbbc031241b1116a9db691a759eceadf&quot;
30-
* @expectedExceptionMessage missing &quot;var&quot; attribute
29+
* @expectedExceptionMessage Syntax error in template "b8ecd121bbbc031241b1116a9db691a759eceadf"
30+
* @expectedExceptionMessage missing "var" attribute
3131
* test required attribute
3232
*/
3333
public function testRequiredAttributeVar()
@@ -37,8 +37,8 @@ public function testRequiredAttributeVar()
3737

3838
/**
3939
* @expectedException SmartyCompilerException
40-
* @expectedExceptionMessage Syntax Error in template &quot;46d3649920e0043f055702ef3ceef0ecdc44b892&quot;
41-
* @expectedExceptionMessage unexpected &quot;bar&quot; attribute
40+
* @expectedExceptionMessage Syntax error in template "46d3649920e0043f055702ef3ceef0ecdc44b892"
41+
* @expectedExceptionMessage unexpected "bar" attribute
4242
* test unexpected attribute
4343
*/
4444
public function testUnexpectedAttribute()
@@ -48,8 +48,8 @@ public function testUnexpectedAttribute()
4848

4949
/**
5050
* @expectedException SmartyCompilerException
51-
* @expectedExceptionMessage Syntax Error in template &quot;d6c824b50e89d8fe12b393ae8ab68daeb7b6c240&quot;
52-
* @expectedExceptionMessage illegal value of option flag &quot;nocache&quot;
51+
* @expectedExceptionMessage Syntax error in template "d6c824b50e89d8fe12b393ae8ab68daeb7b6c240"
52+
* @expectedExceptionMessage illegal value of option flag "nocache"
5353
* test illegal option value
5454
*/
5555
public function testIllegalOptionValue()
@@ -59,7 +59,7 @@ public function testIllegalOptionValue()
5959

6060
/**
6161
* @expectedException SmartyCompilerException
62-
* @expectedExceptionMessage Syntax Error in template &quot;a119616ffa139e7b1145b1cd36adbff7bc9be7cf&quot;
62+
* @expectedExceptionMessage Syntax error in template "a119616ffa139e7b1145b1cd36adbff7bc9be7cf"
6363
* @expectedExceptionMessage too many shorthand attributes
6464
* test too many shorthands
6565
*/

UnitTests/TemplateSource/TagTests/_Error/CompileErrorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function testNoneExistingTemplateError()
3535

3636
/**
3737
* @expectedException SmartyCompilerException
38-
* @expectedExceptionMessage Syntax Error in template &quot;2510bcd51cbc69725f2c3d3484b2c70c00ddaeba&quot;
39-
* @expectedExceptionMessage unknown tag &quot;unknown&quot;
38+
* @expectedExceptionMessage Syntax error in template "2510bcd51cbc69725f2c3d3484b2c70c00ddaeba"
39+
* @expectedExceptionMessage unknown tag "unknown"
4040
* test unkown tag error
4141
*/
4242
public function testUnknownTagError()
@@ -56,8 +56,8 @@ public function testUnclosedTagError()
5656

5757
/**
5858
* @expectedException SmartyCompilerException
59-
* @expectedExceptionMessage Syntax Error in template &quot;599a9cf0e3623a3206bd02a0f5c151d5f5f3f69e&quot;
60-
* @expectedExceptionMessage Unexpected &quot;}&quot;
59+
* @expectedExceptionMessage Syntax error in template "599a9cf0e3623a3206bd02a0f5c151d5f5f3f69e"
60+
* @expectedExceptionMessage Unexpected "}"
6161
* test syntax error
6262
*/
6363
public function testSyntaxError()

UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public function testModifierRegisteredMethodCall()
166166

167167
/**
168168
* @expectedException SmartyCompilerException
169-
* @expectedExceptionMessage Syntax Error in template &quot;4d2e368c483a648d14bbd59592da92aff3b96a2f&quot;
170-
* @expectedExceptionMessage unknown modifier &quot;unknown&quot;
169+
* @expectedExceptionMessage Syntax error in template "4d2e368c483a648d14bbd59592da92aff3b96a2f"
170+
* @expectedExceptionMessage unknown modifier "unknown"
171171
* test unknown modifier error
172172
*/
173173
public function testUnknownModifier()

UnitTests/_Core/Filter/FilterTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@ public function testLoadedVariableFilter()
131131
$tpl->assign('foo', '<?php ?>');
132132
$this->assertEquals('&lt;?php ?&gt;', $this->smarty->fetch($tpl));
133133
}
134+
135+
/**
136+
* test registered post filter
137+
*/
138+
public function testRegisteredVariableFilter2()
139+
{
140+
$var = new VarFilter();
141+
142+
$this->smarty->registerFilter(Smarty::FILTER_VARIABLE, array($var, 'variablefilter'));
143+
$tpl = $this->smarty->createTemplate('string:{$foo}');
144+
$tpl->assign('foo', 'bar');
145+
$this->assertEquals('var{$foo}bar', $this->smarty->fetch($tpl));
146+
}
134147
}
135148

136149
Class VarFilter

0 commit comments

Comments
 (0)