[limb-svn] r6341 - in 3.x/trunk/limb/macro: . src src/tags tests/cases tests/cases/tags
svn at limb-project.com
svn at limb-project.com
Sat Sep 29 00:33:45 MSD 2007
Author: pachanga
Date: 2007-09-29 00:33:45 +0400 (Sat, 29 Sep 2007)
New Revision: 6341
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6341
Modified:
3.x/trunk/limb/macro/common.inc.php
3.x/trunk/limb/macro/src/lmbMacroTagParsingState.class.php
3.x/trunk/limb/macro/src/lmbMacroTokenizer.class.php
3.x/trunk/limb/macro/src/tags/list.tag.php
3.x/trunk/limb/macro/src/tags/wrap.tag.php
3.x/trunk/limb/macro/tests/cases/lmbMacroTagAcceptanceTest.class.php
3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerMalformedTest.class.php
3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerTest.class.php
3.x/trunk/limb/macro/tests/cases/lmbMacroTreeBuilderTest.class.php
3.x/trunk/limb/macro/tests/cases/tags/lmbMacroIncludeTagTest.class.php
3.x/trunk/limb/macro/tests/cases/tags/lmbMacroListTagTest.class.php
3.x/trunk/limb/macro/tests/cases/tags/lmbMacroOutputTagTest.class.php
3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php
Log:
-- migrating to more convenient delimiters {{foo}} (MCR-8)
Modified: 3.x/trunk/limb/macro/common.inc.php
===================================================================
--- 3.x/trunk/limb/macro/common.inc.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/common.inc.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -1,15 +1,15 @@
-<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
- */
-
-/**
- * @package macro
- * @version $Id$
- */
-require_once('limb/core/common.inc.php');
-
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+
+/**
+ * @package macro
+ * @version $Id$
+ */
+require_once('limb/core/common.inc.php');
+
Modified: 3.x/trunk/limb/macro/src/lmbMacroTagParsingState.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroTagParsingState.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/src/lmbMacroTagParsingState.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -38,7 +38,7 @@
{
$tag_node = $this->buildTagNode($tag_info, $tag, $attrs, $self_closed_tag = true);
$tag_node->setHasClosingTag(false);
- $this->tree_builder->pushNode($tag_node); // for cases like <%include%> we do pushNode() and popNode() here.
+ $this->tree_builder->pushNode($tag_node); // for cases like {{include}} we do pushNode() and popNode() here.
$this->tree_builder->popNode();
}
else
@@ -76,7 +76,7 @@
$tag_node = $this->buildTagNode($tag_info, $tag, $attrs, $self_closed_tag = true);
$tag_node->setHasClosingTag(false);
- $this->tree_builder->pushNode($tag_node); // for cases like <%include%> we do pushNode() and popNode() here.
+ $this->tree_builder->pushNode($tag_node); // for cases like {{include}} we do pushNode() and popNode() here.
$this->tree_builder->popNode();
}
Modified: 3.x/trunk/limb/macro/src/lmbMacroTokenizer.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroTokenizer.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/src/lmbMacroTokenizer.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -65,7 +65,7 @@
do
{
$start = $this->position;
- $this->position = strpos($this->rawtext, '<%', $start);
+ $this->position = strpos($this->rawtext, '{{', $start);
if($this->position === false)
{
if($start < $this->length)
@@ -78,10 +78,10 @@
$this->observer->characters(substr($this->rawtext, $start, $this->position - $start));
}
- $this->position += 2; // ignore '<%' string
+ $this->position += 2; // ignore '{{' string
if($this->position >= $this->length)
{
- $this->observer->unexpectedEOF('<%');
+ $this->observer->unexpectedEOF('{{');
return;
}
@@ -93,8 +93,8 @@
case '/':
$start = $this->position;
while($this->position < $this->length &&
- $this->rawtext{$this->position} != '%' &&
- $this->rawtext{$this->position+1} != '>')
+ !($this->rawtext{$this->position} == '}' &&
+ $this->rawtext{$this->position+1} == '}'))
$this->position++;
if($this->position >= $this->length)
@@ -106,11 +106,11 @@
$tag = substr($this->rawtext, $start, $this->position - $start);
$this->observer->endElement($tag);
- $this->position += 2; // ignore '%>' string
+ $this->position += 2; // ignore '}}' string
break;
default:
- while($this->position < $this->length && strpos("%/ \n\r\t", $this->rawtext{$this->position}) === false)
+ while($this->position < $this->length && strpos("}/ \n\r\t", $this->rawtext{$this->position}) === false)
$this->position++;
if($this->position >= $this->length)
@@ -126,11 +126,11 @@
//tag attributes
while($this->position < $this->length &&
- $this->rawtext{$this->position} != '%' &&
+ $this->rawtext{$this->position} != '}' &&
$this->rawtext{$this->position} != '/')
{
$start = $this->position;
- while($this->position < $this->length && strpos("%= \n\r\t", $this->rawtext{$this->position}) === false)
+ while($this->position < $this->length && strpos("}= \n\r\t", $this->rawtext{$this->position}) === false)
$this->position++;
if($this->position >= $this->length)
@@ -181,13 +181,13 @@
return;
}
- if(strpos("/% \n\r\t", $this->rawtext{$this->position}) === false)
+ if(strpos("/} \n\r\t", $this->rawtext{$this->position}) === false)
$this->observer->invalidAttributeSyntax(substr($this->rawtext, $this->position));
}
else
{
$start = $this->position;
- while($this->position < $this->length && strpos("% \n\r\t", $this->rawtext{$this->position}) === false)
+ while($this->position < $this->length && strpos("} \n\r\t", $this->rawtext{$this->position}) === false)
$this->position++;
if($this->position >= $this->length)
@@ -211,7 +211,7 @@
}
//self closing tag check
- if($this->rawtext{$this->position} == '/' && $this->rawtext{$this->position + 1} == '%')
+ if($this->rawtext{$this->position} == '/' && $this->rawtext{$this->position + 1} == '}')
{
$this->position += 2;
if($this->position >= $this->length)
@@ -220,10 +220,10 @@
return;
}
- if($this->rawtext{$this->position} != '>')
+ if($this->rawtext{$this->position} != '}')
{
$start = $this->position;
- while($this->position < $this->length && $this->rawtext{$this->position} != '>')
+ while($this->position < $this->length && $this->rawtext{$this->position} != '}')
$this->position++;
if($this->position >= $this->length)
@@ -242,7 +242,7 @@
else
{
$this->observer->startElement($tag, $attributes);
- //skipping %
+ //skipping }
$this->position += 1;
}
Modified: 3.x/trunk/limb/macro/src/tags/list.tag.php
===================================================================
--- 3.x/trunk/limb/macro/src/tags/list.tag.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/src/tags/list.tag.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -40,10 +40,10 @@
foreach($this->children as $child)
{
- //we want to skip all <%list:*%> tags, since they are rendered manually
+ //we want to skip all {{list:*}} tags, since they are rendered manually
if(!$this->_isOneOfListTags($child))
{
- //tags before <%list:item%> should be rendered only once when counter is 0
+ //tags before {{list:item}} should be rendered only once when counter is 0
if(!$found_item_tag)
{
$code->writePHP('if(' . $counter . ' == 0) {');
@@ -70,7 +70,7 @@
$code->writePHP($counter . '++;');
$code->writePHP('}');
- //tags after <%list:item%> should be rendered only if there were any items
+ //tags after {{list:item}} should be rendered only if there were any items
foreach($postponed_nodes as $node)
{
$code->writePHP('if(' . $counter . ' > 0) {');
Modified: 3.x/trunk/limb/macro/src/tags/wrap.tag.php
===================================================================
--- 3.x/trunk/limb/macro/src/tags/wrap.tag.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/src/tags/wrap.tag.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -32,7 +32,7 @@
$file = $this->get('with');
$this->_compileSourceFileName($file, $compiler);
- //if there's no 'into' attribute we consider that <%into%> tags used instead
+ //if there's no 'into' attribute we consider that {{into}} tags used instead
if($into = $this->get('into'))
{
$tree_builder = $compiler->getTreeBuilder();
@@ -86,7 +86,7 @@
$handlers_str = 'array(';
$methods = array();
- //collecting <%into%> tags
+ //collecting {{into}} tags
if($intos = $this->_collectIntos())
{
foreach($intos as $into)
Modified: 3.x/trunk/limb/macro/tests/cases/lmbMacroTagAcceptanceTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/lmbMacroTagAcceptanceTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/lmbMacroTagAcceptanceTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -45,7 +45,7 @@
function testTemplateRendering()
{
- $code = '<h1><%foo/%><%bar/%></h1>';
+ $code = '<h1>{{foo/}}{{bar/}}</h1>';
$tpl = $this->_createTemplate($code);
$out = $tpl->render();
$this->assertEqual($out, '<h1>foo!bar</h1>');
Modified: 3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerMalformedTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerMalformedTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerMalformedTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -26,9 +26,9 @@
function testOpenElementMalformedClose()
{
$this->listener->expectOnce('characters', array('stuff'));
- $this->listener->expectOnce('invalidEntitySyntax', array('<%tag attribute=\'value\'/%morestuff'));
+ $this->listener->expectOnce('invalidEntitySyntax', array('{{tag attribute=\'value\'/}morestuff'));
$this->listener->expectNever('startElement');
- $this->parser->parse('stuff<%tag attribute=\'value\'/%morestuff');
+ $this->parser->parse('stuff{{tag attribute=\'value\'/}morestuff');
}
function testElementNestedSingleQuote()
@@ -37,7 +37,7 @@
$this->listener->expectOnce('invalidAttributeSyntax');
$this->listener->expectNever('characters');
$this->listener->expectNever('endElement');
- $this->parser->parse('<%tag attribute=\'\'\'%>');
+ $this->parser->parse('{{tag attribute=\'\'\'}}');
}
function testElementNestedDoubleQuote()
@@ -46,7 +46,7 @@
$this->listener->expectOnce('invalidAttributeSyntax');
$this->listener->expectNever('characters');
$this->listener->expectNever('endElement');
- $this->parser->parse('<%tag attribute="""%>');
+ $this->parser->parse('{{tag attribute="""}}');
}
function testElementMalformedAttribute()
@@ -55,7 +55,7 @@
$this->listener->expectOnce('invalidAttributeSyntax');
$this->listener->expectNever('characters');
$this->listener->expectNever('endElement');
- $this->parser->parse('<%tag attribute="test"extra%>');
+ $this->parser->parse('{{tag attribute="test"extra}}');
}
}
Modified: 3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/lmbMacroTokenizerTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -48,7 +48,7 @@
$this->listener->expectOnce('startElement', array('tag', array()));
$this->listener->expectOnce('endElement', array('tag'));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag%><%/tag%>');
+ $this->parser->parse('{{tag}}{{/tag}}');
}
function testEmptyElementSelfClose()
@@ -56,7 +56,7 @@
$this->listener->expectOnce('emptyElement', array('tag', array()));
$this->listener->expectNever('startElement');
$this->listener->expectNever('endElement');
- $this->parser->parse('<%tag/%>');
+ $this->parser->parse('{{tag/}}');
}
function testElementWithContent()
@@ -65,7 +65,7 @@
$this->listener->expectOnce('characters', array('stuff'));
$this->listener->expectOnce('endElement', array('tag'));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag%>stuff<%/tag%>');
+ $this->parser->parse('{{tag}}stuff{{/tag}}');
}
function testElementNestedSingleQuote()
@@ -74,7 +74,7 @@
$this->listener->expectNever('characters');
$this->listener->expectNever('endElement');
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag attribute="\'"%>');
+ $this->parser->parse('{{tag attribute="\'"}}');
}
function testElementNestedDoubleQuote()
@@ -83,14 +83,14 @@
$this->listener->expectNever('characters');
$this->listener->expectNever('endElement');
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag attribute=\'"\'%>');
+ $this->parser->parse('{{tag attribute=\'"\'}}');
}
function testEmptyClose()
{
$this->listener->expectOnce('endElement', array(''));
$this->listener->expectNever('characters');
- $this->parser->parse('<%/%>');
+ $this->parser->parse('{{/}}');
}
function testOutputTag()
@@ -99,7 +99,7 @@
$this->listener->expectNever('characters');
$this->listener->expectNever('endElement');
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%$value%>');
+ $this->parser->parse('{{$value}}');
}
function testElementWithPreContent()
@@ -107,7 +107,7 @@
$this->listener->expectOnce('characters', array('stuff'));
$this->listener->expectOnce('startElement', array('br', array()));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('stuff<%br%>');
+ $this->parser->parse('stuff{{br}}');
}
function testElementWithPostContent()
@@ -115,21 +115,21 @@
$this->listener->expectOnce('startElement', array('br', array()));
$this->listener->expectOnce('characters', array('stuff'));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%br%>stuff');
+ $this->parser->parse('{{br}}stuff');
}
function testExpressionAfterTag()
{
$this->listener->expectOnce('emptyElement', array('br', array()));
$this->listener->expectOnce('characters', array('{$str}'));
- $this->parser->parse('<%br/%>{$str}');
+ $this->parser->parse('{{br/}}{$str}');
}
function testSelfClosingTagWithArgumentsAndNoSpaceBeforeClosing()
{
$this->listener->expectOnce('emptyElement', array('tag', array('str' => 'abcdefgh')));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag str="abcdefgh"/%>');
+ $this->parser->parse('{{tag str="abcdefgh"/}}');
}
function testExpressionAfterTagWithArguments()
@@ -137,7 +137,7 @@
$this->listener->expectOnce('emptyElement', array('tag', array('str' => 'abcdefgh')));
$this->listener->expectOnce('characters', array('{$str}'));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag str="abcdefgh" /%>{$str}');
+ $this->parser->parse('{{tag str="abcdefgh" /}}{$str}');
}
function testMismatchedElements()
@@ -149,37 +149,37 @@
$this->listener->expectCallCount('startElement', 2);
$this->listener->expectCallCount('endElement', 2);
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%b%><%i%>stuff<%/b%><%/i%>');
+ $this->parser->parse('{{b}}{{i}}stuff{{/b}}{{/i}}');
}
function testAttributes()
{
$this->listener->expectOnce('startElement', array('tag', array("a" => "A", "b" => "B", "c" => "C")));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag a="A" b=\'B\' c = "C"%>');
+ $this->parser->parse('{{tag a="A" b=\'B\' c = "C"}}');
}
function testEmptyAttributes()
{
$this->listener->expectOnce('startElement', array('tag', array("a" => NULL, "b" => NULL, "c" => NULL)));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse('<%tag a b c%>');
+ $this->parser->parse('{{tag a b c}}');
}
function testNastyAttributes()
{
- $this->listener->expectOnce('startElement', array('tag', array("a" => "&%$'?<>",
+ $this->listener->expectOnce('startElement', array('tag', array("a" => "&{\$'?<>",
"b" => "\r\n\t\"",
"c" => "")));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse("<%tag a=\"&%$'?<>\" b='\r\n\t\"' c = ''%>");
+ $this->parser->parse("{{tag a=\"&{\$'?<>\" b='\r\n\t\"' c = ''}}");
}
function testAttributesPadding()
{
$this->listener->expectOnce('startElement', array('tag', array("a" => "A", "b" => "B", "c" => "C")));
$this->listener->expectNever('invalidAttributeSyntax');
- $this->parser->parse("<%tag\ta=\"A\"\rb='B'\nc = \"C\"\n%>");
+ $this->parser->parse("{{tag\ta=\"A\"\rb='B'\nc = \"C\"\n}}");
}
}
Modified: 3.x/trunk/limb/macro/tests/cases/lmbMacroTreeBuilderTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/lmbMacroTreeBuilderTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/lmbMacroTreeBuilderTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -156,7 +156,7 @@
function testPushCursor()
{
// This test is essentially a test of the functionality that enables the
- // <%wrap%> implementation.
+ // {{wrap}} implementation.
// Briefly:
// (1) A tree is set up
// (2) A new cursor is pushed
Modified: 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroIncludeTagTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroIncludeTagTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroIncludeTagTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -23,7 +23,7 @@
function testSimpleStaticInclude()
{
- $bar = '<body><%include file="foo.html"/%></body>';
+ $bar = '<body>{{include file="foo.html"/}}</body>';
$foo = '<p>Hello, Bob</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
@@ -37,8 +37,8 @@
function testNestedStaticInclude()
{
- $bar = '<body><%include file="foo.html"/%></body>';
- $foo = '<p>Hello, <%include file="name.html"/%></p>';
+ $bar = '<body>{{include file="foo.html"/}}</body>';
+ $foo = '<p>Hello, {{include file="name.html"/}}</p>';
$name = "Bob";
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
@@ -53,7 +53,7 @@
function testStaticIncludePassVariables()
{
- $bar = '<body><?php $var2=2;?><%include file="foo.html" var1="1" var2="$var2"/%></body>';
+ $bar = '<body><?php $var2=2;?>{{include file="foo.html" var1="1" var2="$var2"/}}</body>';
$foo = '<p>Numbers: <?php echo $var1;?> <?php echo $var2;?></p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
@@ -67,7 +67,7 @@
function testStaticIncludeMixLocalAndTemplateVariables()
{
- $bar = '<body><?php $var2=2;?><%include file="foo.html" var1="1" var2="$var2"/%></body>';
+ $bar = '<body><?php $var2=2;?>{{include file="foo.html" var1="1" var2="$var2"/}}</body>';
$foo = '<p>Numbers: <?php echo $var1;?> <?php echo $var2;?> <?php echo $this->var3;?></p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
@@ -82,7 +82,7 @@
function testDynamicInclude()
{
- $bar = '<body><%include file="$this->file"/%></body>';
+ $bar = '<body>{{include file="$this->file"/}}</body>';
$foo = '<p>Hello!</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
@@ -97,7 +97,7 @@
function testDynamicIncludePassLocalVars()
{
- $bar = '<body><?php $name = "Fred";?><%include file="$this->file" name="$name"/%></body>';
+ $bar = '<body><?php $name = "Fred";?>{{include file="$this->file" name="$name"/}}</body>';
$foo = '<p>Hello, <?php echo $name;?>!</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
@@ -112,7 +112,7 @@
function testDynamicIncludeMixLocalAndTemplateVars()
{
- $bar = '<body><?php $name = "Fred";?><%include file="$this->file" name="$name"/%></body>';
+ $bar = '<body><?php $name = "Fred";?>{{include file="$this->file" name="$name"/}}</body>';
$foo = '<p>Hello, <?php echo $name . " " . $this->lastname;?>!</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
Modified: 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroListTagTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroListTagTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroListTagTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -26,7 +26,7 @@
function testSimpleList()
{
- $list = '<%list using="$#list" as="$item"%><%list:item%><?=$item?> <%/list:item%><%/list%>';
+ $list = '{{list using="$#list" as="$item"}}{{list:item}}<?=$item?> {{/list:item}}{{/list}}';
$list_tpl = $this->_createTemplate($list, 'list.html');
@@ -39,7 +39,7 @@
function testListUsingDefaultItem()
{
- $list = '<%list using="$#list"%><%list:item%><?=$item?> <%/list:item%><%/list%>';
+ $list = '{{list using="$#list"}}{{list:item}}<?=$item?> {{/list:item}}{{/list}}';
$list_tpl = $this->_createTemplate($list, 'list.html');
@@ -52,8 +52,8 @@
function testEmptyList()
{
- $list = '<%list using="$#list" as="$item"%><%list:item%><?=$item?><%/list:item%>' .
- '<%list:empty%>Nothing<%/list:empty%><%/list%>';
+ $list = '{{list using="$#list" as="$item"}}{{list:item}}<?=$item?>{{/list:item}}' .
+ '{{list:empty}}Nothing{{/list:empty}}{{/list}}';
$list_tpl = $this->_createTemplate($list, 'list.html');
@@ -66,7 +66,7 @@
function testShowCounter()
{
- $list = '<%list using="$#list" counter="$ctr"%><%list:item%><?=$ctr?>)<?=$item?> <%/list:item%><%/list%>';
+ $list = '{{list using="$#list" counter="$ctr"}}{{list:item}}<?=$ctr?>)<?=$item?> {{/list:item}}{{/list}}';
$list_tpl = $this->_createTemplate($list, 'list.html');
@@ -79,7 +79,7 @@
function testTextNodesInsideListTag()
{
- $list = '<%list using="$#list" as="$item"%>List: <%list:item%><?=$item?> <%/list:item%> !<%/list%>';
+ $list = '{{list using="$#list" as="$item"}}List: {{list:item}}<?=$item?> {{/list:item}} !{{/list}}';
$list_tpl = $this->_createTemplate($list, 'list.html');
@@ -92,8 +92,8 @@
function testTextNodesInsideListTagWithEmptyListTag()
{
- $list = '<%list using="$#list" as="$item"%>List: <%list:item%><?=$item?> <%/list:item%> !' .
- '<%list:empty%>Nothing<%/list:empty%><%/list%>';
+ $list = '{{list using="$#list" as="$item"}}List: {{list:item}}<?=$item?> {{/list:item}} !' .
+ '{{list:empty}}Nothing{{/list:empty}}{{/list}}';
$list_tpl = $this->_createTemplate($list, 'list.html');
@@ -106,8 +106,8 @@
function testListWithGlue()
{
- $list = '<%list using="$#list" as="$item"%>List:<%list:item%><?=$item?><%/list:item%>!' .
- '<%list:glue%>||<%/list:glue%><%/list%>';
+ $list = '{{list using="$#list" as="$item"}}List:{{list:item}}<?=$item?>{{/list:item}}!' .
+ '{{list:glue}}||{{/list:glue}}{{/list}}';
$list_tpl = $this->_createTemplate($list, 'list.html');
Modified: 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroOutputTagTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroOutputTagTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroOutputTagTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -24,7 +24,7 @@
function testSimpleOutput()
{
- $content = '<%$#var%>';
+ $content = '{{$#var}}';
$tpl = $this->_createTemplate($content, 'tpl.html');
@@ -37,7 +37,7 @@
function testSimpleChainedOutputForArray()
{
- $content = '<%$#var.foo.bar%>';
+ $content = '{{$#var.foo.bar}}';
$tpl = $this->_createTemplate($content, 'tpl.html');
@@ -50,7 +50,7 @@
function testBrokenChainOutputForArray()
{
- $content = '<%$#var.foo.bar.baz%>';
+ $content = '{{$#var.foo.bar.baz}}';
$tpl = $this->_createTemplate($content, 'tpl.html');
@@ -71,7 +71,7 @@
function testSimpleChainedOutputForObject()
{
- $content = '<%$#var.foo.bar%>';
+ $content = '{{$#var.foo.bar}}';
$tpl = $this->_createTemplate($content, 'tpl.html');
@@ -84,7 +84,7 @@
function testBrokenChainOutputForObject()
{
- $content = '<%$#var.foo.bar.baz%>';
+ $content = '{{$#var.foo.bar.baz}}';
$tpl = $this->_createTemplate($content, 'tpl.html');
@@ -105,7 +105,7 @@
function testChainedOutputForMixedArraysAndObjects()
{
- $content = '<%$#var.foo.bar%>';
+ $content = '{{$#var.foo.bar}}';
$tpl = $this->_createTemplate($content, 'tpl.html');
@@ -118,7 +118,7 @@
function testBrokenChainOutputForMixedArraysAndObjects()
{
- $content = '<%$#var.foo.bar.baz%>';
+ $content = '{{$#var.foo.bar.baz}}';
$tpl = $this->_createTemplate($content, 'tpl.html');
Modified: 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php 2007-09-28 05:25:42 UTC (rev 6340)
+++ 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php 2007-09-28 20:33:45 UTC (rev 6341)
@@ -25,8 +25,8 @@
function testSimpleStaticWrap()
{
- $bar = '<%wrap with="foo.html" into="slot1"%>Bob<%/wrap%>';
- $foo = '<p>Hello, <%slot id="slot1"/%></p>';
+ $bar = '{{wrap with="foo.html" into="slot1"}}Bob{{/wrap}}';
+ $foo = '<p>Hello, {{slot id="slot1"/}}</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -39,8 +39,8 @@
function testStaticWrapWithVariables()
{
- $bar = '<%wrap with="foo.html" into="slot1"%><?php echo $this->bob?><%/wrap%>';
- $foo = '<p>Hello, <%slot id="slot1"/%></p>';
+ $bar = '{{wrap with="foo.html" into="slot1"}}<?php echo $this->bob?>{{/wrap}}';
+ $foo = '<p>Hello, {{slot id="slot1"/}}</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -54,9 +54,9 @@
function testNestedStaticWrap()
{
- $bar = '<%wrap with="foo.html" into="slot1"%><?php echo $this->bob?><%/wrap%>';
- $foo = '<%wrap with="zoo.html" into="slot2"%><p>Hello, <%slot id="slot1"/%></p><%/wrap%>';
- $zoo = '<body><%slot id="slot2"/%></body>';
+ $bar = '{{wrap with="foo.html" into="slot1"}}<?php echo $this->bob?>{{/wrap}}';
+ $foo = '{{wrap with="zoo.html" into="slot2"}}<p>Hello, {{slot id="slot1"/}}</p>{{/wrap}}';
+ $zoo = '<body>{{slot id="slot2"/}}</body>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -71,8 +71,8 @@
function testMultiStaticWrap()
{
- $bar = '<%wrap with="foo.html"%><%into slot="slot1"%>Bob<%/into%><%into slot="slot2"%>Thorton<%/into%><%/wrap%>';
- $foo = '<p>Hello, <%slot id="slot2"/%> <%slot id="slot1"/%></p>';
+ $bar = '{{wrap with="foo.html"}}{{into slot="slot1"}}Bob{{/into}}{{into slot="slot2"}}Thorton{{/into}}{{/wrap}}';
+ $foo = '<p>Hello, {{slot id="slot2"/}} {{slot id="slot1"/}}</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -85,8 +85,8 @@
function testSimpleDynamicWrap()
{
- $bar = '<%wrap with="$this->layout" into="slot1"%>Bob<%/wrap%>';
- $foo = '<p>Hello, <%slot id="slot1"/%></p>';
+ $bar = '{{wrap with="$this->layout" into="slot1"}}Bob{{/wrap}}';
+ $foo = '<p>Hello, {{slot id="slot1"/}}</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -100,8 +100,8 @@
function testMultiDynamicWrap()
{
- $bar = '<%wrap with="$this->layout"%><%into slot="slot1"%>Bob<%/into%><%into slot="slot2"%>Thorton<%/into%><%/wrap%>';
- $foo = '<p>Hello, <%slot id="slot2"/%> <%slot id="slot1"/%></p>';
+ $bar = '{{wrap with="$this->layout"}}{{into slot="slot1"}}Bob{{/into}}{{into slot="slot2"}}Thorton{{/into}}{{/wrap}}';
+ $foo = '<p>Hello, {{slot id="slot2"/}} {{slot id="slot1"/}}</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -115,9 +115,9 @@
function testMixStaticAndDynamicWrap()
{
- $bar = '<%wrap with="$this->layout" into="slot1"%><?php echo $this->bob?><%/wrap%>';
- $foo = '<%wrap with="zoo.html" into="slot2"%><p>Hello, <%slot id="slot1"/%></p><%/wrap%>';
- $zoo = '<body><%slot id="slot2"/%></body>';
+ $bar = '{{wrap with="$this->layout" into="slot1"}}<?php echo $this->bob?>{{/wrap}}';
+ $foo = '{{wrap with="zoo.html" into="slot2"}}<p>Hello, {{slot id="slot1"/}}</p>{{/wrap}}';
+ $zoo = '<body>{{slot id="slot2"/}}</body>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -133,9 +133,9 @@
function testNestedDynamicWrap()
{
- $bar = '<%wrap with="$this->layout1" into="slot1"%><?php echo $this->bob?><%/wrap%>';
- $foo = '<%wrap with="$this->layout2" into="slot2"%><p>Hello, <%slot id="slot1"/%></p><%/wrap%>';
- $zoo = '<body><%slot id="slot2"/%></body>';
+ $bar = '{{wrap with="$this->layout1" into="slot1"}}<?php echo $this->bob?>{{/wrap}}';
+ $foo = '{{wrap with="$this->layout2" into="slot2"}}<p>Hello, {{slot id="slot1"/}}</p>{{/wrap}}';
+ $zoo = '<body>{{slot id="slot2"/}}</body>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -152,8 +152,8 @@
function testStaticallyWrappedChildAccessesParentData()
{
- $bar = '<%wrap with="foo.html" into="slot1"%><?php echo $this->bob?><%/wrap%>';
- $foo = '<?php $this->bob = "Bob";?><p>Hello, <%slot id="slot1"/%></p>';
+ $bar = '{{wrap with="foo.html" into="slot1"}}<?php echo $this->bob?>{{/wrap}}';
+ $foo = '<?php $this->bob = "Bob";?><p>Hello, {{slot id="slot1"/}}</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -166,8 +166,8 @@
function testDynamicallyWrappedChildAccessesParentData()
{
- $bar = '<%wrap with="$this->layout" into="slot1"%><?php echo $this->bob?><%/wrap%>';
- $foo = '<?php $this->bob = "Bob";?><p>Hello, <%slot id="slot1"/%></p>';
+ $bar = '{{wrap with="$this->layout" into="slot1"}}<?php echo $this->bob?>{{/wrap}}';
+ $foo = '<?php $this->bob = "Bob";?><p>Hello, {{slot id="slot1"/}}</p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -181,8 +181,8 @@
function testStaticallyWrappedChildLocalVarsAreIsolated()
{
- $bar = '<%wrap with="foo.html" into="slot1"%><?php $foo = "Todd";?><%/wrap%>';
- $foo = '<?php $foo = "Bob";?><%slot id="slot1"/%><?php echo $foo;?>';
+ $bar = '{{wrap with="foo.html" into="slot1"}}<?php $foo = "Todd";?>{{/wrap}}';
+ $foo = '<?php $foo = "Bob";?>{{slot id="slot1"/}}<?php echo $foo;?>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
@@ -195,8 +195,8 @@
function testDynamicallyWrappedChildLocalVarsAreIsolated()
{
- $bar = '<%wrap with="$this->layout" into="slot1"%><?php $foo = "Todd";?><%/wrap%>';
- $foo = '<?php $foo = "Bob";?><%slot id="slot1"/%><?php echo $foo;?>';
+ $bar = '{{wrap with="$this->layout" into="slot1"}}<?php $foo = "Todd";?>{{/wrap}}';
+ $foo = '<?php $foo = "Bob";?>{{slot id="slot1"/}}<?php echo $foo;?>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
$foo_tpl = $this->_createTemplate($foo, 'foo.html');
More information about the limb-svn
mailing list