com php-src: Add Throwable tests: Zend/tests/throwable_00 1.phpt Zend/tests/throwable_002.phpt Zend/tes ts/throwable_003.phpt

From: Date: Mon, 15 Jun 2015 06:47:34 +0000
Subject: com php-src: Add Throwable tests: Zend/tests/throwable_00 1.phpt Zend/tests/throwable_002.phpt Zend/tes ts/throwable_003.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87327@lists.php.net to get a copy of this message
Commit: 103bf7eda084688139e121ec052dc9b7469e1a63 Author: Aaron Piotrowski <aaron@trowski.com> Mon, 15 Jun 2015 01:47:34 -0500 Parents: 8e7e4fb6086b762f753abda92c8c0da652b93420 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=103bf7eda084688139e121ec052dc9b7469e1a63 Log: Add Throwable tests Changed paths: A Zend/tests/throwable_001.phpt A Zend/tests/throwable_002.phpt A Zend/tests/throwable_003.phpt Diff: diff --git a/Zend/tests/throwable_001.phpt b/Zend/tests/throwable_001.phpt new file mode 100644 index 0000000..afcdd72 --- /dev/null +++ b/Zend/tests/throwable_001.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test using an Error as the previous Throwable for an Exception +--CREDITS-- +Aaron Piotrowski <aaron@icicle.io> +--FILE-- +<?php +throw new Exception('Exception message', 0, new Error('Error message')); +?> +--EXPECTF-- + +Fatal error: Uncaught Error: Error message in %s:%d +Stack trace: +#0 {main} + +Next Exception: Exception message in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/throwable_002.phpt b/Zend/tests/throwable_002.phpt new file mode 100644 index 0000000..10fd82b --- /dev/null +++ b/Zend/tests/throwable_002.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test using an Exception as the previous Throwable for an Error +--CREDITS-- +Aaron Piotrowski <aaron@icicle.io> +--FILE-- +<?php +throw new Error('Error message', 0, new Exception('Exception message')); +?> +--EXPECTF-- + +Fatal error: Uncaught Exception: Exception message in %s:%d +Stack trace: +#0 {main} + +Next Error: Error message in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/throwable_003.phpt b/Zend/tests/throwable_003.phpt new file mode 100644 index 0000000..19626a3 --- /dev/null +++ b/Zend/tests/throwable_003.phpt @@ -0,0 +1,11 @@ +--TEST-- +Test user code implementing Throwable results in fatal error +--CREDITS-- +Aaron Piotrowski <aaron@icicle.io> +--FILE-- +<?php +class Failure implements Throwable {} +?> +--EXPECTF-- + +Fatal error: Class Failure cannot implement interface Throwable, extend Exception or Error instead in %s on line %d

« previous php.cvs (#87327) next »