From: Aaron Piotrowski Date: Fri, 26 Jun 2015 14:25:25 +0000 (-0500) Subject: Fix test duplication, add more tests X-Git-Tag: php-7.1.0alpha3~25^2~170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bd95b8cdc7099bc70066d38011f63f0ce9e73d1;p=php Fix test duplication, add more tests --- diff --git a/Zend/tests/indirect_call_string_001.phpt b/Zend/tests/indirect_call_string_001.phpt index 4493d6b3b8..9151de717b 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 40c913ac4c..ecb0b6d80f 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 :()