issue 831 : Fixed a bug that an error occured if conditional statements include line feeds.

issue 843 : Fixed a bug that spaces at the back of template statements are removed.


git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9795 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-11-03 03:56:16 +00:00
parent d74051e15a
commit 8a55d17cef
2 changed files with 9 additions and 4 deletions

View file

@ -46,8 +46,8 @@ class TemplateHandlerTest extends PHPUnit_Framework_TestCase
),
// <!--@if--> ~ <!--@end-->
array(
'<a>Link</a><!--@if($cond)--><strong>Hello, world</strong><!--@end--><dummy />',
'<a>Link</a><?php if($__Context->cond){ ?><strong>Hello, world</strong><?php } ?><dummy />'
'<a>Link</a><!--@if($cond)--><strong>Hello, world</strong><!--@end--> <dummy />',
'<a>Link</a><?php if($__Context->cond){ ?><strong>Hello, world</strong><?php } ?> <dummy />'
),
// <!--@if--> ~ <!--@endif-->
array(
@ -219,6 +219,11 @@ class TemplateHandlerTest extends PHPUnit_Framework_TestCase
'<img cond="$oBodex->display_extra_images[\'mobile\'] && $arr_extra && $arr_extra->bodex->mobile" src="./images/common/mobile.gif" title="mobile" alt="mobile" />',
'<?php if($__Context->oBodex->display_extra_images[\'mobile\'] && $__Context->arr_extra && $__Context->arr_extra->bodex->mobile){ ?><img src="/xe/tests/classes/template/images/common/mobile.gif" title="mobile" alt="mobile" /><?php } ?>'
),
// issue 831
array(
"<li <!--@if(in_array(\$act, array(\n'dispNmsAdminGroupList',\n'dispNmsAdminInsertGroup',\n'dispNmsAdminGroupInfo',\n'dispNmsAdminDeleteGroup')))-->class=\"on\"<!--@endif-->>",
"<li <?php if(in_array(\$__Context->act, array(\n'dispNmsAdminGroupList',\n'dispNmsAdminInsertGroup',\n'dispNmsAdminGroupInfo',\n'dispNmsAdminDeleteGroup'))){ ?>class=\"on\"<?php } ?>>"
),
);
}