You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by gr...@apache.org on 2009/05/23 18:13:59 UTC
svn commit: r777948 -
/incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
Author: grobmeier
Date: Sat May 23 16:13:59 2009
New Revision: 777948
URL: http://svn.apache.org/viewvc?rev=777948&view=rev
Log:
added test for parent setting
Modified:
incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
Modified: incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php?rev=777948&r1=777947&r2=777948&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php Sat May 23 16:13:59 2009
@@ -64,4 +64,26 @@
}
}
+ public function testSettingParents() {
+ $hierarchy = $this->hierarchy;
+ $loggerDE = $hierarchy->getLogger("de");
+ $root = $loggerDE->getParent();
+ self::assertEquals('root', $root->getName());
+
+ $loggerDEBLUB = $hierarchy->getLogger("de.blub");
+ self::assertEquals('de.blub', $loggerDEBLUB->getName());
+ $p = $loggerDEBLUB->getParent();
+ self::assertEquals('de', $p->getName());
+
+ $loggerDEBLA = $hierarchy->getLogger("de.bla");
+ $p = $loggerDEBLA->getParent();
+ self::assertEquals('de', $p->getName());
+
+ $logger3 = $hierarchy->getLogger("de.bla.third");
+ $p = $logger3->getParent();
+ self::assertEquals('de.bla', $p->getName());
+
+ $p = $p->getParent();
+ self::assertEquals('de', $p->getName());
+ }
}