summaryrefslogtreecommitdiff
path: root/ext/reflection/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests')
-rw-r--r--ext/reflection/tests/ReflectionExtension_constructor_error.phpt9
-rw-r--r--ext/reflection/tests/ReflectionFunction_construct.001.phpt14
-rw-r--r--ext/reflection/tests/ReflectionMethod_006.phpt6
-rw-r--r--ext/reflection/tests/ReflectionMethod_constructor_error2.phpt6
-rw-r--r--ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt2
-rw-r--r--ext/reflection/tests/ReflectionProperty_error.phpt9
6 files changed, 17 insertions, 29 deletions
diff --git a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt
index f731ab51cc..235c2ad768 100644
--- a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt
+++ b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt
@@ -7,22 +7,19 @@ Leon Luijkx <leon@phpgg.nl>
<?php
try {
$obj = new ReflectionExtension();
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
$obj = new ReflectionExtension('foo', 'bar');
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
$obj = new ReflectionExtension([]);
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
diff --git a/ext/reflection/tests/ReflectionFunction_construct.001.phpt b/ext/reflection/tests/ReflectionFunction_construct.001.phpt
index 90259ac997..52db7c654d 100644
--- a/ext/reflection/tests/ReflectionFunction_construct.001.phpt
+++ b/ext/reflection/tests/ReflectionFunction_construct.001.phpt
@@ -9,31 +9,27 @@ Steve Seear <stevseea@php.net>
try {
$a = new ReflectionFunction(array(1, 2, 3));
echo "exception not thrown.".PHP_EOL;
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
$a = new ReflectionFunction('nonExistentFunction');
-} catch (Exception $e) {
+} catch (ReflectionException $e) {
echo $e->getMessage().PHP_EOL;
}
try {
$a = new ReflectionFunction();
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
$a = new ReflectionFunction(1, 2);
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
$a = new ReflectionFunction([]);
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
diff --git a/ext/reflection/tests/ReflectionMethod_006.phpt b/ext/reflection/tests/ReflectionMethod_006.phpt
index 0b8228989c..b22a2acc6d 100644
--- a/ext/reflection/tests/ReflectionMethod_006.phpt
+++ b/ext/reflection/tests/ReflectionMethod_006.phpt
@@ -8,14 +8,12 @@ Steve Seear <stevseea@php.net>
try {
new ReflectionMethod();
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
new ReflectionMethod('a', 'b', 'c');
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
diff --git a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt
index 85f8097825..3c521efc64 100644
--- a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt
+++ b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt
@@ -16,13 +16,13 @@ class TestClass
try {
echo "Too few arguments:\n";
$methodInfo = new ReflectionMethod();
-} catch (ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
echo "\nToo many arguments:\n";
$methodInfo = new ReflectionMethod("TestClass", "foo", true);
-} catch (ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
@@ -45,7 +45,7 @@ try {
try{
//invalid 2nd param
$methodInfo = new ReflectionMethod("TestClass", []);
-} catch (ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt
index 1775dee514..a884162fd2 100644
--- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt
+++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt
@@ -25,7 +25,7 @@ class C {
try {
new ReflectionParameter(array ('A', 'b'));
}
-catch(ReflectionException $e) {
+catch(TypeException $e) {
printf( "Ok - %s\n", $e->getMessage());
}
diff --git a/ext/reflection/tests/ReflectionProperty_error.phpt b/ext/reflection/tests/ReflectionProperty_error.phpt
index d3910296b5..ef051b5380 100644
--- a/ext/reflection/tests/ReflectionProperty_error.phpt
+++ b/ext/reflection/tests/ReflectionProperty_error.phpt
@@ -9,21 +9,18 @@ class C {
try {
new ReflectionProperty();
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
new ReflectionProperty('C::p');
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}
try {
new ReflectionProperty('C', 'p', 'x');
-}
-catch(ReflectionException $re) {
+} catch (TypeException $re) {
echo "Ok - ".$re->getMessage().PHP_EOL;
}