Changeset 1245
- Timestamp:
- 01/16/08 15:32:28 (7 months ago)
- Files:
-
- trunk/src/main/php/net/stubbles/auth/storage/stubAuthSessionStorage.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/util/log/stubLogData.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/util/log/stubLogDataFactory.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/integration/RegistryTestCase.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/lang/errorhandler/stubAbstractExceptionHandlerTestCase.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/util/log/stubLogDataFactoryTestCase.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/auth/storage/stubAuthSessionStorage.php
r1243 r1245 32 32 * session key for result storage time 33 33 */ 34 const SESSION_KEY_STORE_TIME = 'net.stubbles.auth.storeTime' 34 const SESSION_KEY_STORE_TIME = 'net.stubbles.auth.storeTime'; 35 35 36 36 /** trunk/src/main/php/net/stubbles/util/log/stubLogData.php
r562 r1245 17 17 interface stubLogData extends stubObject 18 18 { 19 /** 20 * registry key for request class to be used 21 */ 22 const CLASS_REGISTRY_KEY = 'net.stubbles.util.log.class'; 19 23 /** 20 24 * default seperator to be used to seperate the log fields trunk/src/main/php/net/stubbles/util/log/stubLogDataFactory.php
r1230 r1245 52 52 public static function create($target, $level = stubLogger::LEVEL_INFO) 53 53 { 54 $fqClassName = stubRegistry::getConfig( 'net.stubbles.util.log.class', 'net::stubbles::util::log::stubBaseLogData');54 $fqClassName = stubRegistry::getConfig(stubLogData::CLASS_REGISTRY_KEY, 'net::stubbles::util::log::stubBaseLogData'); 55 55 $nqClassName = stubClassLoader::getNonQualifiedClassName($fqClassName); 56 56 if (class_exists($nqClassName, false) === false) { … … 60 60 $logData = new $nqClassName($target, $level); 61 61 if (($logData instanceof stubLogData) === false) { 62 throw new stubRuntimeException('Configured net.stubbles.util.log.classis not an instance of net::stubbles::util::log::stubLogData.');62 throw new stubRuntimeException('Configured ' . stubLogData::CLASS_REGISTRY_KEY . ' is not an instance of net::stubbles::util::log::stubLogData.'); 63 63 } 64 64 trunk/src/test/php/net/stubbles/integration/RegistryTestCase.php
r1242 r1245 9 9 stubClassLoader::load('net::stubbles::util::stubRegistryXJConfInitializer', 10 10 'net::stubbles::ipo::request::stubRequest', 11 'net::stubbles::ipo::session::stubSession' 11 'net::stubbles::ipo::session::stubSession', 12 'net::stubbles::util::log::stubLogData' 12 13 ); 13 14 /** … … 28 29 $this->assertEqual(stubRegistry::getConfig('net.stubbles.language'), 'en_EN'); 29 30 $this->assertEqual(stubRegistry::getConfig('net.stubbles.number.decimals'), 4); 30 $this->assertEqual(stubRegistry::getConfig( 'net.stubbles.util.log.class'), 'net::stubbles::util::log::stubBaseLogData');31 $this->assertEqual(stubRegistry::getConfig(stubLogData::CLASS_REGISTRY_KEY), 'net::stubbles::util::log::stubBaseLogData'); 31 32 $this->assertEqual(stubRegistry::getConfig(stubRequest::CLASS_REGISTRY_KEY), 'net::stubbles::ipo::request::stubWebRequest'); 32 33 $this->assertEqual(stubRegistry::getConfig(stubSession::CLASS_REGISTRY_KEY), 'net::stubbles::ipo::session::stubPHPSession'); trunk/src/test/php/net/stubbles/lang/errorhandler/stubAbstractExceptionHandlerTestCase.php
r1236 r1245 50 50 { 51 51 $this->abstractExceptionHandler = $this->getMock('stubAbstractExceptionHandler', array('fillResponse')); 52 stubRegistry::setConfig( 'net.stubbles.util.log.class', 'net::stubbles::util::log::stubBaseLogData');52 stubRegistry::setConfig(stubLogData::CLASS_REGISTRY_KEY, 'net::stubbles::util::log::stubBaseLogData'); 53 53 $binder = new stubBinder(); 54 54 stubRegistry::set(stubBinder::REGISTRY_KEY, $binder); … … 66 66 67 67 stubRegistry::remove(stubBinder::REGISTRY_KEY); 68 stubRegistry::removeConfig( 'net.stubbles.util.log.class');68 stubRegistry::removeConfig(stubLogData::CLASS_REGISTRY_KEY); 69 69 } 70 70 trunk/src/test/php/net/stubbles/util/log/stubLogDataFactoryTestCase.php
r1230 r1245 40 40 public function testWithoutLoading() 41 41 { 42 stubRegistry::setConfig( 'net.stubbles.util.log.class', 'MockstubLogData');42 stubRegistry::setConfig(stubLogData::CLASS_REGISTRY_KEY, 'MockstubLogData'); 43 43 $logData = stubLogDataFactory::create('foo'); 44 44 $this->assertIsA($logData, 'MockstubLogData'); … … 50 50 public function testWithLoading() 51 51 { 52 stubRegistry::setConfig( 'net.stubbles.util.log.class', 'org::stubbles::test::TestLogData');52 stubRegistry::setConfig(stubLogData::CLASS_REGISTRY_KEY, 'org::stubbles::test::TestLogData'); 53 53 $logData = stubLogDataFactory::create('foo'); 54 54 $this->assertIsA($logData, 'TestLogData'); … … 60 60 public function testWrongInstance() 61 61 { 62 stubRegistry::setConfig( 'net.stubbles.util.log.class', 'stdClass');62 stubRegistry::setConfig(stubLogData::CLASS_REGISTRY_KEY, 'stdClass'); 63 63 $this->expectException('stubRuntimeException'); 64 64 stubLogDataFactory::create('foo');
