summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionProperty_error.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-03-30 12:14:43 +0300
committerDmitry Stogov <dmitry@zend.com>2015-03-30 12:14:43 +0300
commit9155a267adeeb6f442f97892de441e4b6666ce73 (patch)
tree7d525ab7379401c38b4416886655b4753ec5701a /ext/reflection/tests/ReflectionProperty_error.phpt
parentc71c97e101f239d487c7a9797bdf193098d469ca (diff)
parent910a3243063f0490a60e5c3c0e1467a6171f4e39 (diff)
downloadphp-git-9155a267adeeb6f442f97892de441e4b6666ce73.tar.gz
Merge branch 'InternalClassClean' of github.com:Danack/php-src into InternalClassClean
* 'InternalClassClean' of github.com:Danack/php-src: Fixed indentation. Fixed comment style. Fixed commented out code. Reverted change to function name and added note of why it is different from the class it is actually changing. Made UConverter throw an exception if the constructor fails. Fixed PDO constructor to not return null. Fixed fileinfo behaviour. Made Phar throw exception on bad constructor. Converted intl extension to use IntlException in constructors. Fixed SplFixedArray and tests. Fixed ReflectionExtension and ReflectionProperty. Fixed ReflectionFunction, ReflectionMethod and ReflectionParameter. Fixed PDORow behaviour and message.
Diffstat (limited to 'ext/reflection/tests/ReflectionProperty_error.phpt')
-rw-r--r--ext/reflection/tests/ReflectionProperty_error.phpt50
1 files changed, 24 insertions, 26 deletions
diff --git a/ext/reflection/tests/ReflectionProperty_error.phpt b/ext/reflection/tests/ReflectionProperty_error.phpt
index 56de6e1f2e..d3910296b5 100644
--- a/ext/reflection/tests/ReflectionProperty_error.phpt
+++ b/ext/reflection/tests/ReflectionProperty_error.phpt
@@ -7,9 +7,27 @@ class C {
public static $p;
}
-var_dump(new ReflectionProperty());
-var_dump(new ReflectionProperty('C::p'));
-var_dump(new ReflectionProperty('C', 'p', 'x'));
+try {
+ new ReflectionProperty();
+}
+catch(ReflectionException $re) {
+ echo "Ok - ".$re->getMessage().PHP_EOL;
+}
+try {
+ new ReflectionProperty('C::p');
+}
+catch(ReflectionException $re) {
+ echo "Ok - ".$re->getMessage().PHP_EOL;
+}
+
+try {
+ new ReflectionProperty('C', 'p', 'x');
+}
+catch(ReflectionException $re) {
+ echo "Ok - ".$re->getMessage().PHP_EOL;
+}
+
+
$rp = new ReflectionProperty('C', 'p');
var_dump($rp->getName(1));
var_dump($rp->isPrivate(1));
@@ -21,29 +39,9 @@ var_dump($rp->isDefault(1));
?>
--EXPECTF--
-Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 0 given in %s on line %d
-object(ReflectionProperty)#%d (2) {
- ["name"]=>
- string(0) ""
- ["class"]=>
- string(0) ""
-}
-
-Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 1 given in %s on line %d
-object(ReflectionProperty)#%d (2) {
- ["name"]=>
- string(0) ""
- ["class"]=>
- string(0) ""
-}
-
-Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 3 given in %s on line %d
-object(ReflectionProperty)#%d (2) {
- ["name"]=>
- string(0) ""
- ["class"]=>
- string(0) ""
-}
+Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 0 given
+Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 1 given
+Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 3 given
Warning: ReflectionProperty::getName() expects exactly 0 parameters, 1 given in %s on line %d
NULL