Skip to content

Commit e5e7ec1

Browse files
author
Nicolas Van Eenaeme
committed
Added test that was once lost :)
1 parent e06ed9b commit e5e7ec1

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

tests/complex_conditions6.phpt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
--TEST--
2+
testing empty strings
3+
--FILE--
4+
<?php
5+
include('common.inc');
6+
ini_set('blitz.remove_spaces_around_context_tags', 1);
7+
8+
$body = <<<BODY
9+
a: {{var_export(a,1)}}
10+
b: {{var_export(b,1)}}
11+
expression: (a == 'text') || !b
12+
result: {{IF (a == 'text') || !b}}OK{{ELSE}}WRONG{{END}}
13+
14+
expression: (b == 'text') || !b
15+
result: {{IF (b == 'text') || !b}}OK{{ELSE}}WRONG{{END}}
16+
17+
c: {{var_export(c,1)}}
18+
expression: (c == 'text') || !c
19+
result: {{IF (c == 'text') || !c}}WRONG{{ELSE}}OK{{END}}
20+
21+
expression: (c == 'text')
22+
result: {{IF (c == 'text')}}WRONG{{ELSE}}OK{{END}}
23+
24+
expression: !c
25+
result: {{IF !c}}WRONG{{ELSE}}OK{{END}}
26+
27+
BODY;
28+
29+
$T = new Blitz();
30+
$T->load($body);
31+
32+
$T->display(
33+
array(
34+
'a' => '123',
35+
'b' => '',
36+
'c' => 'textarea'
37+
)
38+
);
39+
?>
40+
--EXPECT--
41+
a: '123'
42+
b: ''
43+
expression: (a == 'text') || !b
44+
result: OK
45+
46+
expression: (b == 'text') || !b
47+
result: OK
48+
49+
c: 'textarea'
50+
expression: (c == 'text') || !c
51+
result: OK
52+
53+
expression: (c == 'text')
54+
result: OK
55+
56+
expression: !c
57+
result: OK

0 commit comments

Comments
 (0)