Changeset 1092
- Timestamp:
- 11/30/07 00:02:11 (11 months ago)
- Files:
-
- trunk/src/main/php/net/stubbles/lang/errorhandler (moved) (moved from trunk/src/main/php/net/stubbles/util/errorhandler)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubAbstractExceptionHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubAbstractExceptionHandler.php) (2 diffs)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubCompositeErrorHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubCompositeErrorHandler.php) (4 diffs)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubDisplayExceptionHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubDisplayExceptionHandler.php) (2 diffs)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubErrorHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubErrorHandler.php) (4 diffs)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubExceptionHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubExceptionHandler.php) (2 diffs)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubIllegalArgumentErrorHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubIllegalArgumentErrorHandler.php) (4 diffs)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubLogErrorHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubLogErrorHandler.php) (2 diffs)
- trunk/src/main/php/net/stubbles/lang/errorhandler/stubProdModeExceptionHandler.php (copied) (copied from trunk/src/main/php/net/stubbles/util/errorhandler/stubProdModeExceptionHandler.php) (1 diff)
- trunk/src/test/php/net/stubbles/lang/errorhandler (moved) (moved from trunk/src/test/php/net/stubbles/util/errorhandler)
- trunk/src/test/php/net/stubbles/lang/errorhandler/stubAbstractExceptionHandlerTestCase.php (copied) (copied from trunk/src/test/php/net/stubbles/util/errorhandler/stubAbstractExceptionHandlerTestCase.php) (5 diffs)
- trunk/src/test/php/net/stubbles/lang/errorhandler/stubCompositeErrorHandlerTestCase.php (copied) (copied from trunk/src/test/php/net/stubbles/util/errorhandler/stubCompositeErrorHandlerTestCase.php) (8 diffs)
- trunk/src/test/php/net/stubbles/lang/errorhandler/stubIllegalArgumentErrorHandlerTestCase.php (copied) (copied from trunk/src/test/php/net/stubbles/util/errorhandler/stubIllegalArgumentErrorHandlerTestCase.php) (5 diffs)
- trunk/src/test/php/net/stubbles/lang/errorhandler/stubLogErrorHandlerTestCase.php (copied) (copied from trunk/src/test/php/net/stubbles/util/errorhandler/stubLogErrorHandlerTestCase.php) (3 diffs)
- trunk/src/test/php/net/stubbles/stubTestSuite.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/util/UtilTestSuite.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/lang/errorhandler/stubAbstractExceptionHandler.php
r1091 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 9 stubClassLoader::load('net.stubbles.ipo.response.stubBaseResponse', 10 'net.stubbles. util.errorhandler.stubExceptionHandler'10 'net.stubbles.lang.errorhandler.stubExceptionHandler' 11 11 ); 12 12 /** … … 14 14 * 15 15 * @package stubbles 16 * @subpackage util_errorhandler16 * @subpackage lang_errorhandler 17 17 * @see http://php.net/set_exception_handler 18 18 */ trunk/src/main/php/net/stubbles/lang/errorhandler/stubCompositeErrorHandler.php
r420 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 stubClassLoader::load('net.stubbles. util.errorhandler.stubErrorHandler');9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubErrorHandler'); 10 10 /** 11 11 * Container for a collection of PHP error handlers. 12 12 * 13 13 * @package stubbles 14 * @subpackage util_errorhandler14 * @subpackage lang_errorhandler 15 15 * @see http://php.net/set_error_handler 16 16 */ … … 33 33 $this->errorHandlers[] = $errorHandler; 34 34 } 35 35 36 36 /** 37 37 * checks whether this error handler is responsible for the given error … … 57 57 return false; 58 58 } 59 59 60 60 /** 61 61 * checks whether this error is supressable … … 78 78 return true; 79 79 } 80 80 81 81 /** 82 82 * handles the given error trunk/src/main/php/net/stubbles/lang/errorhandler/stubDisplayExceptionHandler.php
r1089 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 stubClassLoader::load('net.stubbles. util.errorhandler.stubAbstractExceptionHandler');9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubAbstractExceptionHandler'); 10 10 /** 11 11 * Exception handler that displays the exception message nicely formated in the response. … … 14 14 * 15 15 * @package stubbles 16 * @subpackage util_errorhandler16 * @subpackage lang_errorhandler 17 17 */ 18 18 class stubDisplayExceptionHandler extends stubAbstractExceptionHandler trunk/src/main/php/net/stubbles/lang/errorhandler/stubErrorHandler.php
r412 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 9 /** … … 11 11 * 12 12 * @package stubbles 13 * @subpackage util_errorhandler13 * @subpackage lang_errorhandler 14 14 * @see http://php.net/set_error_handler 15 15 */ 16 interface stubErrorHandler 16 interface stubErrorHandler extends stubObject 17 17 { 18 18 /** … … 27 27 */ 28 28 public function isResponsible($level, $message, $file = null, $line = null, array $context = array()); 29 29 30 30 /** 31 31 * checks whether this error is supressable … … 42 42 */ 43 43 public function isSupressable($level, $message, $file = null, $line = null, array $context = array()); 44 44 45 45 /** 46 46 * handles the given error trunk/src/main/php/net/stubbles/lang/errorhandler/stubExceptionHandler.php
r1089 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 9 /** … … 11 11 * 12 12 * @package stubbles 13 * @subpackage util_errorhandler13 * @subpackage lang_errorhandler 14 14 * @see http://php.net/set_exception_handler 15 15 */ trunk/src/main/php/net/stubbles/lang/errorhandler/stubIllegalArgumentErrorHandler.php
r777 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 stubClassLoader::load('net.stubbles.lang.e xceptions.stubIllegalArgumentException',10 'net.stubbles. util.errorhandler.stubErrorHandler'9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubErrorHandler', 10 'net.stubbles.lang.exceptions.stubIllegalArgumentException' 11 11 ); 12 12 /** … … 18 18 * 19 19 * @package stubbles 20 * @subpackage util_errorhandler20 * @subpackage lang_errorhandler 21 21 * @see http://php.net/set_error_handler 22 22 */ … … 41 41 return (bool) preg_match('/Argument [0-9]+ passed to [a-zA-Z0-9_]+::[a-zA-Z0-9_]+\(\) must be an instance of [a-zA-Z0-9_]+, [a-zA-Z0-9_]+ given/', $message); 42 42 } 43 43 44 44 /** 45 45 * checks whether this error is supressable … … 59 59 return false; 60 60 } 61 61 62 62 /** 63 63 * handles the given error trunk/src/main/php/net/stubbles/lang/errorhandler/stubLogErrorHandler.php
r1088 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 stubClassLoader::load('net.stubbles.events.events', 10 'net.stubbles.util.errorhandler.stubErrorHandler', 9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubErrorHandler', 11 10 'net.stubbles.util.log.log' 12 11 ); … … 19 18 * 20 19 * @package stubbles 21 * @subpackage util_errorhandler20 * @subpackage lang_errorhandler 22 21 * @see http://php.net/set_error_handler 23 22 */ trunk/src/main/php/net/stubbles/lang/errorhandler/stubProdModeExceptionHandler.php
r1089 r1092 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler7 * @subpackage lang_errorhandler 8 8 */ 9 stubClassLoader::load('net.stubbles. util.errorhandler.stubAbstractExceptionHandler');9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubAbstractExceptionHandler'); 10 10 /** 11 11 * Exception handler for production mode: triggers a 500 Internal Server Error response. 12 12 * 13 13 * @package stubbles 14 * @subpackage util_errorhandler14 * @subpackage lang_errorhandler 15 15 */ 16 16 class stubProdModeExceptionHandler extends stubAbstractExceptionHandler trunk/src/test/php/net/stubbles/lang/errorhandler/stubAbstractExceptionHandlerTestCase.php
r1091 r1092 1 1 <?php 2 2 /** 3 * Tests for net::stubbles:: util::errorhandler::stubAbstractExceptionHandler.3 * Tests for net::stubbles::lang::errorhandler::stubAbstractExceptionHandler. 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler_test7 * @subpackage lang_errorhandler_test 8 8 */ 9 stubClassLoader::load('net.stubbles.util.errorhandler.stubAbstractExceptionHandler', 9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubAbstractExceptionHandler', 10 'net.stubbles.lang.exceptions.stubChainedException', 10 11 'net.stubbles.util.log.stubMemoryLogAppender' 11 12 ); … … 17 18 * 18 19 * @package stubbles 19 * @subpackage util_errorhandler_test20 * @subpackage lang_errorhandler_test 20 21 */ 21 22 class TestAbstractExceptionHandlerException extends stubChainedException … … 28 29 public function getClassName() 29 30 { 30 return 'net.stubbles. util.errorhandler.test.TestAbstractExceptionHandlerException';31 return 'net.stubbles.lang.errorhandler.test.TestAbstractExceptionHandlerException'; 31 32 } 32 33 } 33 34 /** 34 * Tests for net::stubbles:: util::errorhandler::stubAbstractExceptionHandler.35 * Tests for net::stubbles::lang::errorhandler::stubAbstractExceptionHandler. 35 36 * 36 37 * @package stubbles 37 * @subpackage util_errorhandler_test38 * @subpackage lang_errorhandler_test 38 39 */ 39 40 class stubAbstractExceptionHandlerTestCase extends UnitTestCase … … 68 69 69 70 stubRegistry::remove(stubBinder::REGISTRY_KEY); 71 stubRegistry::removeConfig('net.stubbles.util.log.class'); 70 72 } 71 73 … … 127 129 $this->assertEqual($logData['foo'][0]->getLevel(), stubLogger::LEVEL_DEBUG); 128 130 $logDataContents = explode(stubLogData::SEPERATOR, $logData['foo'][0]->get()); 129 $this->assertEqual($logDataContents[1], 'net.stubbles. util.errorhandler.test.TestAbstractExceptionHandlerException');131 $this->assertEqual($logDataContents[1], 'net.stubbles.lang.errorhandler.test.TestAbstractExceptionHandlerException'); 130 132 $this->assertEqual($logDataContents[2], 'chained exception'); 131 133 $this->assertEqual($logDataContents[3], __FILE__); trunk/src/test/php/net/stubbles/lang/errorhandler/stubCompositeErrorHandlerTestCase.php
r415 r1092 1 1 <?php 2 2 /** 3 * Tests for net .stubbles.util.errorhandler.stubCompositeErrorHandler3 * Tests for net::stubbles::lang::errorhandler::stubCompositeErrorHandler 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler_test7 * @subpackage lang_errorhandler_test 8 8 */ 9 stubClassLoader::load('net.stubbles. util.errorhandler.stubCompositeErrorHandler');9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubCompositeErrorHandler'); 10 10 Mock::generate('stubErrorHandler'); 11 11 /** 12 * Tests for net .stubbles.util.errorhandler.stubCompositeErrorHandler12 * Tests for net::stubbles::lang::errorhandler::stubCompositeErrorHandler 13 13 * 14 14 * @package stubbles 15 * @subpackage util_errorhandler_test15 * @subpackage lang_errorhandler_test 16 16 */ 17 17 class stubCompositeErrorHandlerTestCase extends UnitTestCase … … 41 41 */ 42 42 protected $mockErrorHandler3; 43 43 44 44 /** 45 45 * set up test environment … … 55 55 $this->compositeErrorHandler->addErrorHandler($this->mockErrorHandler3); 56 56 } 57 57 58 58 /** 59 59 * assure that isResponsible() works correct … … 71 71 $this->assertFalse($this->compositeErrorHandler->isResponsible(1, 'foo')); 72 72 } 73 73 74 74 /** 75 75 * assure that isSupressable() works correct … … 87 87 $this->assertTrue($this->compositeErrorHandler->isSupressable(1, 'foo')); 88 88 } 89 89 90 90 /** 91 91 * assure that handle() works correct … … 104 104 $this->assertTrue($this->compositeErrorHandler->handle(1, 'foo')); 105 105 } 106 106 107 107 /** 108 108 * assure that handle() works correct … … 124 124 error_reporting($oldLevel); 125 125 } 126 126 127 127 /** 128 128 * assure that handle() works correct … … 147 147 error_reporting($oldLevel); 148 148 } 149 149 150 150 /** 151 151 * assure that handle() works correct trunk/src/test/php/net/stubbles/lang/errorhandler/stubIllegalArgumentErrorHandlerTestCase.php
r415 r1092 1 1 <?php 2 2 /** 3 * Tests for net .stubbles.util.errorhandler.stubIllegalArgumentErrorHandler3 * Tests for net::stubbles::lang::errorhandler::stubIllegalArgumentErrorHandler 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler_test7 * @subpackage lang_errorhandler_test 8 8 */ 9 stubClassLoader::load('net.stubbles. util.errorhandler.stubIllegalArgumentErrorHandler');9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubIllegalArgumentErrorHandler'); 10 10 /** 11 * Tests for net .stubbles.util.errorhandler.stubIllegalArgumentErrorHandler11 * Tests for net::stubbles::lang::errorhandler::stubIllegalArgumentErrorHandler 12 12 * 13 13 * @package stubbles 14 * @subpackage util_errorhandler_test14 * @subpackage lang_errorhandler_test 15 15 */ 16 16 class stubIllegalArgumentErrorHandlerTestCase extends UnitTestCase … … 22 22 */ 23 23 protected $illegalArgumentErrorHandler; 24 24 25 25 /** 26 26 * set up test environment … … 30 30 $this->illegalArgumentErrorHandler = new stubIllegalArgumentErrorHandler(); 31 31 } 32 32 33 33 /** 34 34 * assure that isResponsible() works correct … … 40 40 $this->assertTrue($this->illegalArgumentErrorHandler->isResponsible(E_RECOVERABLE_ERROR, 'Argument 1 passed to Class::method() must be an instance of AnotherClass, string given')); 41 41 } 42 42 43 43 /** 44 44 * assure that isSupressable() works correct … … 48 48 $this->assertFalse($this->illegalArgumentErrorHandler->isSupressable(E_RECOVERABLE_ERROR, 'foo')); 49 49 } 50 50 51 51 /** 52 52 * assure that handle() works correct trunk/src/test/php/net/stubbles/lang/errorhandler/stubLogErrorHandlerTestCase.php
r1091 r1092 1 1 <?php 2 2 /** 3 * Tests for net::stubbles:: util::errorhandler::stubLogErrorHandler.3 * Tests for net::stubbles::lang::errorhandler::stubLogErrorHandler. 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage util_errorhandler_test7 * @subpackage lang_errorhandler_test 8 8 */ 9 stubClassLoader::load('net.stubbles. util.errorhandler.stubLogErrorHandler',9 stubClassLoader::load('net.stubbles.lang.errorhandler.stubLogErrorHandler', 10 10 'net.stubbles.util.log.stubMemoryLogAppender' 11 11 ); … … 13 13 14 14 /** 15 * Tests for net::stubbles:: util::errorhandler::stubLogErrorHandler.15 * Tests for net::stubbles::lang::errorhandler::stubLogErrorHandler. 16 16 * 17 17 * @package stubbles 18 * @subpackage util_errorhandler_test18 * @subpackage lang_errorhandler_test 19 19 */ 20 20 class stubLogErrorHandlerTestCase extends UnitTestCase … … 49 49 50 50 stubRegistry::remove(stubBinder::REGISTRY_KEY); 51 stubRegistry::removeConfig('net.stubbles.util.log.class'); 51 52 } 52 53 trunk/src/test/php/net/stubbles/stubTestSuite.php
r894 r1092 23 23 $this->TestSuite('All base classes tests'); 24 24 $this->addTestFile($dir . '/stubClassLoaderTestCase.php'); 25 26 // lang 25 27 $this->addTestFile($dir . '/lang/stubBaseObjectTestCase.php'); 26 28 $this->addTestFile($dir . '/lang/stubEnumTestCase.php'); 29 30 // error handler 31 $this->addTestFile($dir . '/lang/errorhandler/stubAbstractExceptionHandlerTestCase.php'); 32 $this->addTestFile($dir . '/lang/errorhandler/stubCompositeErrorHandlerTestCase.php'); 33 $this->addTestFile($dir . '/lang/errorhandler/stubIllegalArgumentErrorHandlerTestCase.php'); 34 $this->addTestFile($dir . '/lang/errorhandler/stubLogErrorHandlerTestCase.php'); 35 36 // exceptions 27 37 $this->addTestFile($dir . '/lang/exceptions/stubExceptionTestCase.php'); 28 38 $this->addTestFile($dir . '/lang/exceptions/stubChainedExceptionTestCase.php'); 39 40 // serialize 29 41 $this->addTestFile($dir . '/lang/serialize/stubSerializableObjectTestCase.php'); 30 42 $this->addTestFile($dir . '/lang/serialize/stubSerializedObjectTestCase.php'); trunk/src/test/php/net/stubbles/util/UtilTestSuite.php
r1091 r1092 39 39 $this->addTestFile($dir . '/datespan/stubDateSpanWeekTestCase.php'); 40 40 41 // error handler42 $this->addTestFile($dir . '/errorhandler/stubAbstractExceptionHandlerTestCase.php');43 $this->addTestFile($dir . '/errorhandler/stubCompositeErrorHandlerTestCase.php');44 $this->addTestFile($dir . '/errorhandler/stubIllegalArgumentErrorHandlerTestCase.php');45 $this->addTestFile($dir . '/errorhandler/stubLogErrorHandlerTestCase.php');46 47 41 // logging api 48 42 $this->addTestFile($dir . '/log/stubLoggerTestCase.php');
