[limb-svn] r6524 - 3.x/trunk/limb/macro/tests/cases
svn at limb-project.com
svn at limb-project.com
Sat Nov 17 14:23:10 MSK 2007
Author: serega
Date: 2007-11-17 14:23:10 +0300 (Sat, 17 Nov 2007)
New Revision: 6524
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6524
Modified:
3.x/trunk/limb/macro/tests/cases/lmbMacroTagTest.class.php
Log:
-- lmbMacroTag :: findUpChild() added (with tests) that allows to look children upwards
Modified: 3.x/trunk/limb/macro/tests/cases/lmbMacroTagTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/lmbMacroTagTest.class.php 2007-11-17 11:16:42 UTC (rev 6523)
+++ 3.x/trunk/limb/macro/tests/cases/lmbMacroTagTest.class.php 2007-11-17 11:23:10 UTC (rev 6524)
@@ -77,6 +77,28 @@
$this->assertFalse($this->node->findChild('Test'));
}
+ function testFindUpChild()
+ {
+ $node1 = new lmbMacroNode();
+ $node1->setId('foo');
+ $node2 = new lmbMacroNode();
+ $node2->setId('bar');
+ $parent1 = new lmbMacroNode();
+ $parent1->setId('parent1');
+ $parent2 = new lmbMacroNode();
+ $parent2->setId('parent2');
+
+ $parent1->addChild($node1);
+ $parent2->addChild($node2);
+
+ $this->node->addChild($parent1);
+ $this->node->addChild($parent2);
+
+ $this->assertEqual($node2->findUpChild('foo')->getId(), $node1->getId());
+ $this->assertEqual($parent1->findUpChild('parent2')->getId(), $parent2->getId());
+ $this->assertEqual($parent1->findUpChild('foo')->getId(), $node1->getId());
+ }
+
function testFindChildByClass()
{
$mock = new MockMacroNode();
More information about the limb-svn
mailing list