Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b708b08
Make zpp failures always throw, independent of strict_types
nikic Feb 5, 2019
094b224
Rename some _exception APIs to _error
nikic Feb 19, 2019
1156bc5
Remove explicit uses of ZEND_PARSE_PARAMS_THROW
nikic Feb 19, 2019
3c10cf1
Start on test fixes
nikic Feb 19, 2019
14a702c
More test fixes
nikic Mar 5, 2019
32e5c7a
Intl: Don't separately report "bad arguments" errors
nikic Mar 5, 2019
90b29e4
More test updates
nikic Mar 5, 2019
48df358
Test tweaks
nikic Mar 5, 2019
f92fa89
gd tweaks
nikic Mar 5, 2019
e99ea84
Test tweaks
nikic Mar 5, 2019
3448a4c
Gmp fixes
nikic Mar 5, 2019
56d6635
Hash fixes
nikic Mar 5, 2019
2f2ee46
pcre fixes
nikic Mar 5, 2019
73de76c
Reflection fixes
nikic Mar 5, 2019
f67dc49
sockets test fixes
nikic Mar 6, 2019
3e0b31a
Remove some unnecessary error handler setting
nikic Mar 6, 2019
1f801dc
SPL test fixes
nikic Mar 6, 2019
29483fe
Standard array test updates
nikic Mar 6, 2019
4f7c13c
More spl fixes
nikic Mar 6, 2019
5d6e116
bz2 test fixes
nikic Mar 7, 2019
1f29b78
finfo test updates
nikic Mar 7, 2019
bdaa18a
filter test updates
nikic Mar 7, 2019
f40459c
json test updates
nikic Mar 7, 2019
01edef7
ftp test fixes
nikic Mar 7, 2019
a9f1a60
libxml test fixes
nikic Mar 7, 2019
226c2ff
openssl test fixes
nikic Mar 7, 2019
2d92914
phar test fixes
nikic Mar 7, 2019
73157d8
readline test fixes
nikic Mar 7, 2019
2fbf0a7
session test fixes
nikic Mar 7, 2019
a844db6
array test fixes
nikic Mar 7, 2019
c9f894d
class_object test fixes
nikic Mar 7, 2019
69eec09
general functions test fixes
nikic Mar 7, 2019
8e5a097
More string test fixes
nikic Mar 7, 2019
c3b19ec
More general functions test fixes
nikic Mar 7, 2019
9e590e7
Partial
nikic Mar 7, 2019
4ce6877
Math test fixes
nikic Mar 7, 2019
c1845f5
Stream test fixes
nikic Mar 7, 2019
98dce51
Misc test fixes
nikic Mar 7, 2019
5fd6079
Misc test updates
nikic Mar 8, 2019
1fd8ec5
mysqli test updates
nikic Mar 8, 2019
784762c
file test fixes
nikic Mar 8, 2019
7ae628a
Misc test updates
nikic Mar 8, 2019
d001b6a
Fix pgsql tests
nikic Mar 8, 2019
e182baa
Misc test fixes
nikic Mar 8, 2019
21853d0
Misc test updates
nikic Mar 8, 2019
30635d1
Misc fixes
nikic Mar 8, 2019
7d10143
Don't use custom soap error handling during zpp
nikic Mar 8, 2019
cfaecfb
Fix soap tests
nikic Mar 8, 2019
b7612d7
Remove zend_internal_type_error use in win32 specific code
nikic Mar 8, 2019
8f40d39
Use placeholder
nikic Mar 8, 2019
adc65e5
Try to fix windows tests
nikic Mar 8, 2019
d2ddf35
Fix more win32 tests
nikic Mar 11, 2019
5e4d9ba
Fix m32 tests
nikic Mar 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reflection fixes
  • Loading branch information
nikic committed Mar 8, 2019
commit 73de76ca2bd97d696cc3f2eea6f06c0f2f166037
17 changes: 4 additions & 13 deletions ext/reflection/tests/ReflectionClass_constructor_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ReflectionClass::__constructor() - bad arguments
<?php
try {
var_dump(new ReflectionClass());
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}

Expand Down Expand Up @@ -34,7 +34,7 @@ try {

try {
var_dump(new ReflectionClass("stdClass", 1));
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}

Expand All @@ -46,21 +46,12 @@ try {

?>
--EXPECTF--
Warning: ReflectionClass::__construct() expects exactly 1 parameter, 0 given in %s on line 3
object(ReflectionClass)#%d (1) {
["name"]=>
string(0) ""
}
ReflectionClass::__construct() expects exactly 1 parameter, 0 given
Class does not exist
Class 1 does not exist
Class 1 does not exist

Notice: Array to string conversion in %s on line 27
Class Array does not exist

Warning: ReflectionClass::__construct() expects exactly 1 parameter, 2 given in %s on line 33
object(ReflectionClass)#%d (1) {
["name"]=>
string(0) ""
}
ReflectionClass::__construct() expects exactly 1 parameter, 2 given
Class X does not exist
18 changes: 1 addition & 17 deletions ext/reflection/tests/ReflectionClass_getConstant_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,14 @@ class C {

$rc = new ReflectionClass("C");
echo "Check invalid params:\n";
var_dump($rc->getConstant());
var_dump($rc->getConstant("myConst", "myConst"));
var_dump($rc->getConstant(null));
var_dump($rc->getConstant(1));
var_dump($rc->getConstant(1.5));
var_dump($rc->getConstant(true));
var_dump($rc->getConstant(array(1,2,3)));
var_dump($rc->getConstant(new C));
?>
--EXPECTF--
--EXPECT--
Check invalid params:

Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 0 given in %s on line 8
NULL

Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 2 given in %s on line 9
NULL
bool(false)
bool(false)
bool(false)
bool(false)

Warning: ReflectionClass::getConstant() expects parameter 1 to be string, array given in %s on line 14
NULL

Warning: ReflectionClass::getConstant() expects parameter 1 to be string, object given in %s on line 15
NULL
26 changes: 9 additions & 17 deletions ext/reflection/tests/ReflectionClass_getMethod_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ $rc = new ReflectionClass("C");
echo "Check invalid params:\n";
try {
var_dump($rc->getMethod());
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($rc->getMethod("f", "f"));
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
Expand All @@ -43,32 +43,24 @@ try {
}
try {
var_dump($rc->getMethod(array(1,2,3)));
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($rc->getMethod(new C));
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}


?>
--EXPECTF--
--EXPECT--
Check invalid params:

Warning: ReflectionClass::getMethod() expects exactly 1 parameter, 0 given in %s on line 9
NULL

Warning: ReflectionClass::getMethod() expects exactly 1 parameter, 2 given in %s on line 14
NULL
ReflectionClass::getMethod() expects exactly 1 parameter, 0 given
ReflectionClass::getMethod() expects exactly 1 parameter, 2 given
Method does not exist
Method 1 does not exist
Method 1.5 does not exist
Method 1 does not exist

Warning: ReflectionClass::getMethod() expects parameter 1 to be string, array given in %s on line 39
NULL

Warning: ReflectionClass::getMethod() expects parameter 1 to be string, object given in %s on line 44
NULL
ReflectionClass::getMethod() expects parameter 1 to be string, array given
ReflectionClass::getMethod() expects parameter 1 to be string, object given
7 changes: 5 additions & 2 deletions ext/reflection/tests/ReflectionClass_getParentClass.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ class Foo {}

class Bar extends Foo {}

$rc1 = new ReflectionClass("Bar");
var_dump($rc1->getParentClass());
$rc = new ReflectionClass("Bar");
$parent = $rc->getParentClass();
$grandParent = $parent->getParentClass();
var_dump($parent, $grandParent);
?>
--EXPECTF--
object(ReflectionClass)#%d (1) {
["name"]=>
string(3) "Foo"
}
bool(false)
38 changes: 0 additions & 38 deletions ext/reflection/tests/ReflectionClass_getParentClass_001.phpt

This file was deleted.

26 changes: 9 additions & 17 deletions ext/reflection/tests/ReflectionClass_getProperty_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ $rc = new ReflectionClass("C");
echo "Check invalid params:\n";
try {
var_dump($rc->getProperty());
} catch (exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($rc->getProperty("a", "a"));
} catch (exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
Expand All @@ -43,30 +43,22 @@ try {
}
try {
var_dump($rc->getProperty(array(1,2,3)));
} catch (exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($rc->getProperty(new C));
} catch (exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECTF--
--EXPECT--
Check invalid params:

Warning: ReflectionClass::getProperty() expects exactly 1 parameter, 0 given in %s on line 9
NULL

Warning: ReflectionClass::getProperty() expects exactly 1 parameter, 2 given in %s on line 14
NULL
ReflectionClass::getProperty() expects exactly 1 parameter, 0 given
ReflectionClass::getProperty() expects exactly 1 parameter, 2 given
Property does not exist
Property 1 does not exist
Property 1.5 does not exist
Property 1 does not exist

Warning: ReflectionClass::getProperty() expects parameter 1 to be string, array given in %s on line 39
NULL

Warning: ReflectionClass::getProperty() expects parameter 1 to be string, object given in %s on line 44
NULL
ReflectionClass::getProperty() expects parameter 1 to be string, array given
ReflectionClass::getProperty() expects parameter 1 to be string, object given
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class C {
$rc = new ReflectionClass('C');
try {
var_dump($rc->getStaticPropertyValue("x", "default value", 'blah'));
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($rc->getStaticPropertyValue());
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
Expand All @@ -32,20 +32,15 @@ try {
}
try {
var_dump($rc->getStaticPropertyValue(array(1,2,3)));
} catch (Exception $e) {
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}


?>
--EXPECTF--
Warning: ReflectionClass::getStaticPropertyValue() expects at most 2 parameters, 3 given in %s on line 8
NULL

Warning: ReflectionClass::getStaticPropertyValue() expects at least 1 parameter, 0 given in %s on line 13
NULL
--EXPECT--
ReflectionClass::getStaticPropertyValue() expects at most 2 parameters, 3 given
ReflectionClass::getStaticPropertyValue() expects at least 1 parameter, 0 given
Class C does not have a property named
string(3) "def"

Warning: ReflectionClass::getStaticPropertyValue() expects parameter 1 to be string, array given in %s on line 28
NULL
ReflectionClass::getStaticPropertyValue() expects parameter 1 to be string, array given
18 changes: 1 addition & 17 deletions ext/reflection/tests/ReflectionClass_hasConstant_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,14 @@ class C {

$rc = new ReflectionClass("C");
echo "Check invalid params:\n";
var_dump($rc->hasConstant());
var_dump($rc->hasConstant("myConst", "myConst"));
var_dump($rc->hasConstant(null));
var_dump($rc->hasConstant(1));
var_dump($rc->hasConstant(1.5));
var_dump($rc->hasConstant(true));
var_dump($rc->hasConstant(array(1,2,3)));
var_dump($rc->hasConstant(new C));
?>
--EXPECTF--
--EXPECT--
Check invalid params:

Warning: ReflectionClass::hasConstant() expects exactly 1 parameter, 0 given in %s on line 8
NULL

Warning: ReflectionClass::hasConstant() expects exactly 1 parameter, 2 given in %s on line 9
NULL
bool(false)
bool(false)
bool(false)
bool(false)

Warning: ReflectionClass::hasConstant() expects parameter 1 to be string, array given in %s on line 14
NULL

Warning: ReflectionClass::hasConstant() expects parameter 1 to be string, object given in %s on line 15
NULL
18 changes: 1 addition & 17 deletions ext/reflection/tests/ReflectionClass_hasMethod_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,14 @@ class C {

$rc = new ReflectionClass("C");
echo "Check invalid params:\n";
var_dump($rc->hasMethod());
var_dump($rc->hasMethod("f", "f"));
var_dump($rc->hasMethod(null));
var_dump($rc->hasMethod(1));
var_dump($rc->hasMethod(1.5));
var_dump($rc->hasMethod(true));
var_dump($rc->hasMethod(array(1,2,3)));
var_dump($rc->hasMethod(new C));
?>
--EXPECTF--
--EXPECT--
Check invalid params:

Warning: ReflectionClass::hasMethod() expects exactly 1 parameter, 0 given in %s on line 8
NULL

Warning: ReflectionClass::hasMethod() expects exactly 1 parameter, 2 given in %s on line 9
NULL
bool(false)
bool(false)
bool(false)
bool(false)

Warning: ReflectionClass::hasMethod() expects parameter 1 to be string, array given in %s on line 14
NULL

Warning: ReflectionClass::hasMethod() expects parameter 1 to be string, object given in %s on line 15
NULL
16 changes: 0 additions & 16 deletions ext/reflection/tests/ReflectionClass_hasProperty_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,14 @@ class C {

$rc = new ReflectionClass("C");
echo "Check invalid params:\n";
var_dump($rc->hasProperty());
var_dump($rc->hasProperty("a", "a"));
var_dump($rc->hasProperty(null));
var_dump($rc->hasProperty(1));
var_dump($rc->hasProperty(1.5));
var_dump($rc->hasProperty(true));
var_dump($rc->hasProperty(array(1,2,3)));
var_dump($rc->hasProperty(new C));
?>
--EXPECTF--
Check invalid params:

Warning: ReflectionClass::hasProperty() expects exactly 1 parameter, 0 given in %s on line 8
NULL

Warning: ReflectionClass::hasProperty() expects exactly 1 parameter, 2 given in %s on line 9
NULL
bool(false)
bool(false)
bool(false)
bool(false)

Warning: ReflectionClass::hasProperty() expects parameter 1 to be string, array given in %s on line 14
NULL

Warning: ReflectionClass::hasProperty() expects parameter 1 to be string, object given in %s on line 15
NULL
Loading