Author: grobmeier
Date: Wed May 20 06:02:45 2009
New Revision: 776570

URL: http://svn.apache.org/viewvc?rev=776570&view=rev
Log:
encapsulated property access (used already defined method instead of properties)

Modified:
    incubator/log4php/trunk/src/main/php/LoggerHierarchy.php
    incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
    incubator/log4php/trunk/src/test/php/LoggerLevelTest.php
    incubator/log4php/trunk/src/test/php/LoggerRootTest.php

Modified: incubator/log4php/trunk/src/main/php/LoggerHierarchy.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerHierarchy.php?rev=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerHierarchy.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerHierarchy.php Wed May 20 
06:02:45 2009
@@ -234,7 +234,7 @@
         * @return boolean
         */
        public function isDisabled($level) {
-               return ($this->threshold->level > $level->level);
+               return ($this->threshold->toInt() > $level->toInt());
        }
        
        /**

Modified: incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php?rev=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php Wed May 20 
06:02:45 2009
@@ -31,7 +31,7 @@
        }
        
        public function testIfLevelIsInitiallyLevelDebug() {
-               self::assertEquals('DEBUG', 
$this->hierarchy->getRootLogger()->getLevel()->levelStr);
+               self::assertEquals('DEBUG', 
$this->hierarchy->getRootLogger()->getLevel()->toString());
        }
 
        public function testIfNameIsRoot() {
@@ -54,8 +54,8 @@
                $logger = $this->hierarchy->getLogger('test');
                
self::assertEquals(count($this->hierarchy->getCurrentLoggers()), 1);
                $this->hierarchy->resetConfiguration();
-               
self::assertEquals($this->hierarchy->getRootLogger()->getLevel()->levelStr, 
'DEBUG');
-               self::assertEquals($this->hierarchy->getThreshold()->levelStr, 
'ALL');
+               
self::assertEquals($this->hierarchy->getRootLogger()->getLevel()->toString(), 
'DEBUG');
+               
self::assertEquals($this->hierarchy->getThreshold()->toString(), 'ALL');
                
self::assertEquals(count($this->hierarchy->getCurrentLoggers()), 1);
                foreach($this->hierarchy->getCurrentLoggers() as $l) {
                        self::assertEquals($l->getLevel(), null);

Modified: incubator/log4php/trunk/src/test/php/LoggerLevelTest.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerLevelTest.php?rev=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerLevelTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerLevelTest.php Wed May 20 
06:02:45 2009
@@ -29,9 +29,9 @@
         
        protected function doTestLevel($o, $code, $str, $syslog) {
                self::assertTrue( $o instanceof LoggerLevel );
-               self::assertEquals( $o->level, $code);
-               self::assertEquals( $o->levelStr, $str);
-               self::assertEquals( $o->syslogEquivalent, $syslog);
+               self::assertEquals( $o->toInt(), $code);
+               self::assertEquals( $o->toString(), $str);
+               self::assertEquals( $o->getSyslogEquivalent(), $syslog);
        }
 
        public function testLevelOff() {

Modified: incubator/log4php/trunk/src/test/php/LoggerRootTest.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerRootTest.php?rev=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerRootTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerRootTest.php Wed May 20 06:02:45 
2009
@@ -31,7 +31,7 @@
        }
         
        public function testIfLevelIsInitiallyLevelAll() {
-               self::assertEquals($this->loggerRoot->getLevel()->levelStr, 
'ALL');
+               self::assertEquals($this->loggerRoot->getLevel()->toString(), 
'ALL');
        }
 
        public function testIfNameIsRoot() {


Reply via email to