[limb-svn] r6306 - 3.x/trunk/limb/macro/tests/cases/tags

svn at limb-project.com svn at limb-project.com
Sun Sep 16 16:29:26 MSD 2007


Author: pachanga
Date: 2007-09-16 16:29:26 +0400 (Sun, 16 Sep 2007)
New Revision: 6306
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6306

Modified:
   3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php
Log:
-- adding some more tests

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-16 10:15:05 UTC (rev 6305)
+++ 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php	2007-09-16 12:29:26 UTC (rev 6306)
@@ -133,6 +133,35 @@
     $this->assertEqual($out, '<body><p>Hello, Bob</p></body>');
   }
 
+  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_tpl = $this->_createTemplate($bar, 'bar.html');
+    $foo_tpl = $this->_createTemplate($foo, 'foo.html');
+
+    $macro = $this->_createMacro($bar_tpl);
+
+    $out = $macro->render();
+    $this->assertEqual($out, '<p>Hello, Bob</p>');
+  }
+
+  function TODO_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_tpl = $this->_createTemplate($bar, 'bar.html');
+    $foo_tpl = $this->_createTemplate($foo, 'foo.html');
+
+    $macro = $this->_createMacro($bar_tpl);
+    $macro->set('layout', 'foo.html');
+
+    $out = $macro->render();
+    $this->assertEqual($out, '<p>Hello, Bob</p>');
+  }
+
   protected function _createMacro($file)
   {
     $base_dir = LIMB_VAR_DIR . '/tpl';



More information about the limb-svn mailing list