From 8bd95b8cdc7099bc70066d38011f63f0ce9e73d1 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Fri, 26 Jun 2015 09:25:25 -0500 Subject: [PATCH] Fix test duplication, add more tests --- Zend/tests/indirect_call_string_001.phpt | 3 +++ Zend/tests/indirect_call_string_002.phpt | 29 +++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) 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 :() -- 2.50.1