Changeset 1096
- Timestamp:
- 11/30/07 13:02:54 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/lang/stubMode.php
r1095 r1096 7 7 * @subpackage lang 8 8 */ 9 stubClassLoader::load('net.stubbles.lang.stubEnum'); 9 stubClassLoader::load('net.stubbles.lang.stubEnum', 10 'net.stubbles.lang.exceptions.stubIllegalArgumentException' 11 ); 10 12 /** 11 13 * Enum for different runtime modes of Stubbles. … … 40 42 * @package stubbles 41 43 * @subpackage lang 42 * @todo create net.stubbles.util.errorhandler.stubDefaultErrorHandler43 * @todo unit test44 44 * @todo think about possibility for custom modes 45 45 */ … … 95 95 * @var bool 96 96 */ 97 protected $ enableCache= true;97 protected $cacheEnabled = true; 98 98 99 99 /** … … 130 130 'type' => self::HANDLER_INSTANCE 131 131 ); 132 self::$STAGE-> enableCache= false;132 self::$STAGE->cacheEnabled = false; 133 133 134 134 // development mode … … 138 138 'type' => self::HANDLER_INSTANCE 139 139 ); 140 self::$DEV-> enableCache= false;140 self::$DEV->cacheEnabled = false; 141 141 } 142 142 … … 229 229 if (self::HANDLER_INSTANCE === $handler['type']) { 230 230 if (is_string($handler['class']) === true) { 231 $instance = stubClassLoader::getNonQualifiedClassName($handler['class']); 231 $class = stubClassLoader::getNonQualifiedClassName($handler['class']); 232 $instance = new $class(); 232 233 } else { 233 234 $instance = $handler['class']; … … 237 238 } 238 239 240 if (is_string($handler['class']) === false) { 241 throw new stubIllegalArgumentException('Callback type should be stubMode::HANDLER_STATIC, but given handler class is an instance.'); 242 } 243 239 244 return array(stubClassLoader::getNonQualifiedClassName($handler['class']), $handler['method']); 240 245 } trunk/src/test/php/net/stubbles/stubTestSuite.php
r1092 r1096 27 27 $this->addTestFile($dir . '/lang/stubBaseObjectTestCase.php'); 28 28 $this->addTestFile($dir . '/lang/stubEnumTestCase.php'); 29 $this->addTestFile($dir . '/lang/stubModeTestCase.php'); 29 30 30 31 // error handler
