com php-src: Fix test duplication, add more tests: Zend/tests/i ndirect_call_string_001.phpt Zend/tests/indirec t_call_string_002.phpt
| From: | Bob Weinand | Date: | Fri, 26 Jun 2015 14:30:01 +0000 |
| Subject: | com php-src: Fix test duplication, add more tests: Zend/tests/i ndirect_call_string_001.phpt Zend/tests/indirec t_call_string_002.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87546@lists.php.net to get a copy of this message | ||
Commit: 8bd95b8cdc7099bc70066d38011f63f0ce9e73d1
Author: Aaron Piotrowski <aaron@trowski.com> Fri, 26 Jun 2015 09:25:25 -0500
Committer: Bob Weinand <bobwei9@hotmail.com> Fri, 26 Jun 2015 16:30:01 +0200
Parents: 36e2d26adbecce264ba90bb7d479c9de95e9ca8e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8bd95b8cdc7099bc70066d38011f63f0ce9e73d1
Log:
Fix test duplication, add more tests
Changed paths:
M Zend/tests/indirect_call_string_001..phpt
M Zend/tests/indirect_call_string_002.phpt
Diff:
diff --git a/Zend/tests/indirect_call_string_001.phpt b/Zend/tests/indirect_call_string_001.phpt
index 4493d6b..9151de7 100644
--- a/Zend/tests/indirect_call_string_001.phpt
+++ b/Zend/tests/indirect_call_string_001.phpt
@@ -16,7 +16,10 @@ namespace TestNamespace
printf("Static method called with args: %s, %s, %s\n", $arg1, $arg2, $arg3);
}
}
+}
+namespace CallNamespace
+{
// Test basic call using Class::method syntax.
$callback = 'TestNamespace\TestClass::staticMethod';
$callback();
diff --git a/Zend/tests/indirect_call_string_002.phpt b/Zend/tests/indirect_call_string_002.phpt
index 40c913a..ecb0b6d 100644
--- a/Zend/tests/indirect_call_string_002.phpt
+++ b/Zend/tests/indirect_call_string_002.phpt
@@ -19,7 +19,7 @@ $callback = 'TestClass::';
$callback();
// Test array syntax with empty class name
-$callback = '::method';
+$callback = ['', 'method'];
try {
$callback();
} catch (Error $e) {
@@ -49,6 +49,30 @@ try {
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
+
+// Test string ending in single colon
+$callback = 'Class:';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+// Test string beginning in single colon
+$callback = ':method';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+// Test single colon
+$callback = ':';
+try {
+ $callback();
+} catch (Error $e) {
+ echo $e->getMessage() . "\n";
+}
?>
--EXPECT--
string(0) ""
@@ -57,3 +81,6 @@ Class '' not found
Class '' not found
Class '' not found
Class '' not found
+Call to undefined function Class:()
+Call to undefined function :method()
+Call to undefined function :()