Skip to content

Commit 8bd95b8

Browse files
trowskibwoebi
authored andcommitted
Fix test duplication, add more tests
1 parent 36e2d26 commit 8bd95b8

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

Zend/tests/indirect_call_string_001.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ namespace TestNamespace
1616
printf("Static method called with args: %s, %s, %s\n", $arg1, $arg2, $arg3);
1717
}
1818
}
19+
}
1920

21+
namespace CallNamespace
22+
{
2023
// Test basic call using Class::method syntax.
2124
$callback = 'TestNamespace\TestClass::staticMethod';
2225
$callback();

Zend/tests/indirect_call_string_002.phpt

+28-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $callback = 'TestClass::';
1919
$callback();
2020

2121
// Test array syntax with empty class name
22-
$callback = '::method';
22+
$callback = ['', 'method'];
2323
try {
2424
$callback();
2525
} catch (Error $e) {
@@ -49,6 +49,30 @@ try {
4949
} catch (Error $e) {
5050
echo $e->getMessage() . "\n";
5151
}
52+
53+
// Test string ending in single colon
54+
$callback = 'Class:';
55+
try {
56+
$callback();
57+
} catch (Error $e) {
58+
echo $e->getMessage() . "\n";
59+
}
60+
61+
// Test string beginning in single colon
62+
$callback = ':method';
63+
try {
64+
$callback();
65+
} catch (Error $e) {
66+
echo $e->getMessage() . "\n";
67+
}
68+
69+
// Test single colon
70+
$callback = ':';
71+
try {
72+
$callback();
73+
} catch (Error $e) {
74+
echo $e->getMessage() . "\n";
75+
}
5276
?>
5377
--EXPECT--
5478
string(0) ""
@@ -57,3 +81,6 @@ Class '' not found
5781
Class '' not found
5882
Class '' not found
5983
Class '' not found
84+
Call to undefined function Class:()
85+
Call to undefined function :method()
86+
Call to undefined function :()

0 commit comments

Comments
 (0)