]> granicus.if.org Git - php/commitdiff
Fix test duplication, add more tests
authorAaron Piotrowski <aaron@trowski.com>
Fri, 26 Jun 2015 14:25:25 +0000 (09:25 -0500)
committerBob Weinand <bobwei9@hotmail.com>
Fri, 26 Jun 2015 14:30:01 +0000 (16:30 +0200)
Zend/tests/indirect_call_string_001.phpt
Zend/tests/indirect_call_string_002.phpt

index 4493d6b3b88e79f5e6f55a8f8485014503fe2ae9..9151de717be00260e1d471202dce756454492321 100644 (file)
@@ -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();
index 40c913ac4c42e224fab2a1b7ccc6af2066496382..ecb0b6d80ff94973f304a4dbb51c937f44fd7f3f 100644 (file)
@@ -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 :()