com php-src: Changed AssertionException to AssertionError: Zend/tests/assert/expect_002.phpt Zend/tests/assert /expect_003.phpt
Zend/tests/assert/expect_00 4.phpt Zend/tests/assert/expect_005.phpt Zend /tests/assert/expect_007.phpt Zend/tests/assert/exp ect_008.phpt
Zend/tests/assert/expect_009 .phpt Zend/tests/assert/expect_010.phpt Zend/te sts/assert/expect_011.phpt Zend/tests/exception_ 011.phpt
Zend/tests/exception_012.phpt ex t/reflection/tests/Refl

From: Date: Mon, 15 Jun 2015 04:52:39 +0000
Subject: com php-src: Changed AssertionException to AssertionError: Zend/tests/assert/expect_002.phpt Zend/tests/assert /expect_003.phpt
Zend/tests/assert/expect_00 4.phpt Zend/tests/assert/expect_005.phpt Zend /tests/assert/expect_007.phpt Zend/tests/assert/exp ect_008.phpt
Zend/tests/assert/expect_009 .phpt Zend/tests/assert/expect_010.phpt Zend/te sts/assert/expect_011.phpt Zend/tests/exception_ 011.phpt
Zend/tests/exception_012.phpt ex t/reflection/tests/Refl
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87329@lists.php.net to get a copy of this message
Commit: 482985ca38a46cef833e9f8be81f909790c8441e Author: Aaron Piotrowski <aaron@trowski.com> Sun, 14 Jun 2015 23:52:39 -0500 Parents: 4d590ac35a3a68b8b453cd9bbf3f1300c2507d87 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=482985ca38a46cef833e9f8be81f909790c8441e Log: Changed AssertionException to AssertionError Changed paths: M Zend/tests/assert/expect_002.phpt M Zend/tests/assert/expect_003.phpt M Zend/tests/assert/expect_004.phpt M Zend/tests/assert/expect_005.phpt M Zend/tests/assert/expect_007.phpt M Zend/tests/assert/expect_008.phpt M Zend/tests/assert/expect_009.phpt M Zend/tests/assert/expect_010.phpt M Zend/tests/assert/expect_011.phpt M Zend/tests/exception_011.phpt M Zend/tests/exception_012.phpt M ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt M ext/standard/assert.c

diff --git a/Zend/tests/assert/expect_002.phpt b/Zend/tests/assert/expect_002.phpt index f3062b7..3da88e6 100644 --- a/Zend/tests/assert/expect_002.phpt +++ b/Zend/tests/assert/expect_002.phpt @@ -9,7 +9,7 @@ assert(false); var_dump(true); ?> --EXPECTF-- -Fatal error: Uncaught AssertionException: assert(false) in %sexpect_002.php:%d +Fatal error: Uncaught AssertionError: assert(false) in %sexpect_002.php:%d Stack trace: #0 %sexpect_002.php(%d): assert(false, 'assert(false)') #1 {main} diff --git a/Zend/tests/assert/expect_003.phpt b/Zend/tests/assert/expect_003.phpt index 9a35f36..350fca6 100644 --- a/Zend/tests/assert/expect_003.phpt +++ b/Zend/tests/assert/expect_003.phpt @@ -7,7 +7,7 @@ assert.exception=1 <?php try { assert(false); -} catch (AssertionException $ex) { +} catch (AssertionError $ex) { var_dump($ex->getMessage()); } ?> diff --git a/Zend/tests/assert/expect_004.phpt b/Zend/tests/assert/expect_004.phpt index 8b1e648..111e372 100644 --- a/Zend/tests/assert/expect_004.phpt +++ b/Zend/tests/assert/expect_004.phpt @@ -7,7 +7,7 @@ assert.exception=1 <?php try { assert(false, "I require this to succeed"); -} catch (AssertionException $ex) { +} catch (AssertionError $ex) { var_dump($ex->getMessage()); } ?> diff --git a/Zend/tests/assert/expect_005.phpt b/Zend/tests/assert/expect_005.phpt index 0a296d6..f2c91f2 100644 --- a/Zend/tests/assert/expect_005.phpt +++ b/Zend/tests/assert/expect_005.phpt @@ -8,7 +8,7 @@ assert.exception=1 try { /* by passing we test there are no leaks upon success */ assert(true, "I require this to succeed"); -} catch (AssertionException $ex) { +} catch (AssertionError $ex) { var_dump($ex->getMessage()); } var_dump(true); diff --git a/Zend/tests/assert/expect_007.phpt b/Zend/tests/assert/expect_007.phpt index feed56e..d744258 100644 --- a/Zend/tests/assert/expect_007.phpt +++ b/Zend/tests/assert/expect_007.phpt @@ -11,12 +11,12 @@ $data = array( "value" => "testing" ); -class HeaderMalfunctionException extends AssertionException {} +class HeaderMalfunctionError extends AssertionError {} -assert (preg_match("~^([a-zA-Z0-9-]+)$~", $data["key"]), new HeaderMalfunctionException("malformed key found at {$next} \"{$data["key"]}\"")); +assert (preg_match("~^([a-zA-Z0-9-]+)$~", $data["key"]), new HeaderMalfunctionError("malformed key found at {$next} \"{$data["key"]}\"")); ?> --EXPECTF-- -Fatal error: Uncaught HeaderMalfunctionException: malformed key found at 1 "X-HTTP " in %sexpect_007.php:10 +Fatal error: Uncaught HeaderMalfunctionError: malformed key found at 1 "X-HTTP " in %sexpect_007.php:10 Stack trace: #0 {main} thrown in %sexpect_007.php on line 10 diff --git a/Zend/tests/assert/expect_008.phpt b/Zend/tests/assert/expect_008.phpt index 64e524c..10c56e5 100644 --- a/Zend/tests/assert/expect_008.phpt +++ b/Zend/tests/assert/expect_008.phpt @@ -12,7 +12,7 @@ class One { } class Two extends One {} -class OdEar extends AssertionException {} +class OdEar extends AssertionError {} function blah(){ return 1; } diff --git a/Zend/tests/assert/expect_009.phpt b/Zend/tests/assert/expect_009.phpt index a41cba4..984a9bf 100644 --- a/Zend/tests/assert/expect_009.phpt +++ b/Zend/tests/assert/expect_009.phpt @@ -17,7 +17,7 @@ class Two extends One { new Two(); ?> --EXPECTF-- -Fatal error: Uncaught AssertionException: assert(false) in %sexpect_009.php:%d +Fatal error: Uncaught AssertionError: assert(false) in %sexpect_009.php:%d Stack trace: #0 %sexpect_009.php(%d): assert(false, 'assert(false)') #1 %sexpect_009.php(%d): Two->__construct() diff --git a/Zend/tests/assert/expect_010.phpt b/Zend/tests/assert/expect_010.phpt index 8301d40..c366521 100644 --- a/Zend/tests/assert/expect_010.phpt +++ b/Zend/tests/assert/expect_010.phpt @@ -15,7 +15,7 @@ class Two extends One {} new Two(); ?> --EXPECTF-- -Fatal error: Uncaught AssertionException: assert(false) in %sexpect_010.php:%d +Fatal error: Uncaught AssertionError: assert(false) in %sexpect_010.php:%d Stack trace: #0 %sexpect_010.php(%d): assert(false, 'assert(false)') #1 %sexpect_010.php(%d): One->__construct() diff --git a/Zend/tests/assert/expect_011.phpt b/Zend/tests/assert/expect_011.phpt index a48aa9f..e68852e 100644 --- a/Zend/tests/assert/expect_011.phpt +++ b/Zend/tests/assert/expect_011.phpt @@ -5,7 +5,7 @@ zend.assertions=1 assert.exception=1 --FILE-- <?php -class MyExpectations extends AssertionException { +class MyExpectations extends AssertionError { public function __toString() { return sprintf( "[Message]: %s", __CLASS__); @@ -22,7 +22,7 @@ class Two extends One {} new Two(); ?> --EXPECTF-- -Fatal error: Uncaught AssertionException: [Message]: MyExpectations in %sexpect_011.php:%d +Fatal error: Uncaught AssertionError: [Message]: MyExpectations in %sexpect_011.php:%d Stack trace: #0 %sexpect_011.php(%d): assert(false, '[Message]: MyEx...') #1 %sexpect_011.php(%d): One->__construct() diff --git a/Zend/tests/exception_011.phpt b/Zend/tests/exception_011.phpt index d128f06..850a3ec 100644 --- a/Zend/tests/exception_011.phpt +++ b/Zend/tests/exception_011.phpt @@ -13,7 +13,7 @@ assert(false); --EXPECTHEADERS-- Content-type: text/html; charset=UTF-8 --EXPECTF-- -Fatal error: Uncaught AssertionException: assert(false) in %sexception_011.php:%d +Fatal error: Uncaught AssertionError: assert(false) in %sexception_011.php:%d Stack trace: #0 %sexception_011.php(%d): assert(false, 'assert(false)') #1 {main} diff --git a/Zend/tests/exception_012.phpt b/Zend/tests/exception_012.phpt index eaeaef8..bf00529 100644 --- a/Zend/tests/exception_012.phpt +++ b/Zend/tests/exception_012.phpt @@ -13,7 +13,7 @@ $func(); --EXPECTHEADERS-- Content-type: text/html; charset=UTF-8 --EXPECTF-- -Fatal error: Uncaught AssertionException: assert(false) in %sexception_012.php(%d) : runtime-created function:%d +Fatal error: Uncaught AssertionError: assert(false) in %sexception_012.php(%d) : runtime-created function:%d Stack trace: #0 %sexception_012.php(%d) : runtime-created function(%d): assert(false, 'assert(false)') #1 %sexception_012.php(%d): __lambda_func() diff --git a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt index 0728d50..3fea08c 100644 --- a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt +++ b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt @@ -17,6 +17,6 @@ array(4) { [2]=> %s(9) "Directory" [3]=> - %s(18) "AssertionException" + %s(14) "AssertionError" } ==DONE== diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 236c2c1..7054278 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -37,7 +37,7 @@ ZEND_END_MODULE_GLOBALS(assert) ZEND_DECLARE_MODULE_GLOBALS(assert) -static zend_class_entry *assertion_exception_ce; +static zend_class_entry *assertion_error_ce; #ifdef ZTS #define ASSERTG(v) ZEND_TSRMG(assert_globals_id, zend_assert_globals *, v) @@ -113,8 +113,8 @@ PHP_MINIT_FUNCTION(assert) /* {{{ */ REGISTER_LONG_CONSTANT("ASSERT_QUIET_EVAL", ASSERT_QUIET_EVAL, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("ASSERT_EXCEPTION", ASSERT_EXCEPTION, CONST_CS|CONST_PERSISTENT); - INIT_CLASS_ENTRY(ce, "AssertionException", NULL); - assertion_exception_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default()); + INIT_CLASS_ENTRY(ce, "AssertionError", NULL); + assertion_error_ce = zend_register_internal_class_ex(&ce, zend_get_error()); return SUCCESS; } @@ -244,14 +244,14 @@ PHP_FUNCTION(assert) if (ASSERTG(exception)) { if (!description) { - zend_throw_exception(assertion_exception_ce, NULL, E_ERROR); + zend_throw_exception(assertion_error_ce, NULL, E_ERROR); } else if (Z_TYPE_P(description) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(description), assertion_exception_ce)) { + instanceof_function(Z_OBJCE_P(description), assertion_error_ce)) { Z_ADDREF_P(description); zend_throw_exception_object(description); } else { zend_string *str = zval_get_string(description); - zend_throw_exception(assertion_exception_ce, str->val, E_ERROR); + zend_throw_exception(assertion_error_ce, str->val, E_ERROR); zend_string_release(str); } } else if (ASSERTG(warning)) {
« previous php.cvs (#87329) next »