From db4152cc8cfdd05dc3ea02fa1df77fc02e19ee9f Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 9 Sep 2018 11:23:58 +0200 Subject: [PATCH] tests: consolidated --- ...ection.getParameterDefaultValue.php71.phpt | 40 ----------- .../Reflection.getParameterDefaultValue.phpt | 36 ++++++---- .../Reflection.getParameterType.php71.phpt | 32 --------- tests/Utils/Reflection.getParameterType.phpt | 4 +- .../Utils/Reflection.getReturnType.php7.phpt | 67 ------------------- ...p71.phpt => Reflection.getReturnType.phpt} | 16 +++++ .../Strings.Regexp.errors.backtrack.phpt | 2 +- .../Strings.Regexp.errors.compilation.phpt | 4 +- tests/Utils/Strings.Regexp.errors.utf8.phpt | 2 +- tests/Utils/Strings.replace().php53.phpt | 16 ----- tests/Utils/Strings.replace().phpt | 5 +- tests/Utils/Strings.split().phpt | 8 +++ .../fixtures.reflection/defaultValue.71.php | 28 -------- .../fixtures.reflection/defaultValue.php | 27 +++++--- 14 files changed, 74 insertions(+), 213 deletions(-) delete mode 100644 tests/Utils/Reflection.getParameterDefaultValue.php71.phpt delete mode 100644 tests/Utils/Reflection.getParameterType.php71.phpt delete mode 100644 tests/Utils/Reflection.getReturnType.php7.phpt rename tests/Utils/{Reflection.getReturnType.php71.phpt => Reflection.getReturnType.phpt} (79%) delete mode 100644 tests/Utils/Strings.replace().php53.phpt delete mode 100644 tests/Utils/fixtures.reflection/defaultValue.71.php diff --git a/tests/Utils/Reflection.getParameterDefaultValue.php71.phpt b/tests/Utils/Reflection.getParameterDefaultValue.php71.phpt deleted file mode 100644 index ccc3e1aa3..000000000 --- a/tests/Utils/Reflection.getParameterDefaultValue.php71.phpt +++ /dev/null @@ -1,40 +0,0 @@ -getParameters(); - -Assert::same('Undeclared', Reflection::getParameterType($params[0])); -Assert::same('Test\B', Reflection::getParameterType($params[1])); -Assert::same('array', Reflection::getParameterType($params[2])); -Assert::same('callable', Reflection::getParameterType($params[3])); -Assert::null(Reflection::getParameterType($params[4])); -Assert::same('Test\B', Reflection::getParameterType($params[5])); diff --git a/tests/Utils/Reflection.getParameterType.phpt b/tests/Utils/Reflection.getParameterType.phpt index 362b34343..869266982 100644 --- a/tests/Utils/Reflection.getParameterType.phpt +++ b/tests/Utils/Reflection.getParameterType.phpt @@ -16,7 +16,7 @@ require __DIR__ . '/../bootstrap.php'; class A { - public function method(Undeclared $undeclared, B $b, array $array, callable $callable, self $self, $none) + public function method(Undeclared $undeclared, B $b, array $array, callable $callable, self $self, $none, ?B $nullable) { } } @@ -37,7 +37,7 @@ Assert::same('array', Reflection::getParameterType($params[2])); Assert::same('callable', Reflection::getParameterType($params[3])); Assert::same('A', Reflection::getParameterType($params[4])); Assert::null(Reflection::getParameterType($params[5])); - +Assert::same('Test\B', Reflection::getParameterType($params[6])); $method = new ReflectionMethod('AExt', 'methodExt'); $params = $method->getParameters(); diff --git a/tests/Utils/Reflection.getReturnType.php7.phpt b/tests/Utils/Reflection.getReturnType.php7.phpt deleted file mode 100644 index 9061a59ee..000000000 --- a/tests/Utils/Reflection.getReturnType.php7.phpt +++ /dev/null @@ -1,67 +0,0 @@ - '#', diff --git a/tests/Utils/Strings.split().phpt b/tests/Utils/Strings.split().phpt index cd516e3aa..b291e9613 100644 --- a/tests/Utils/Strings.split().phpt +++ b/tests/Utils/Strings.split().phpt @@ -28,3 +28,11 @@ Assert::same([ ',', 'c', ], Strings::split('a, b, c', '#(,)\s*#', PREG_SPLIT_NO_EMPTY)); + +Assert::same([ + ['a', 0], + [',', 1], + ['b', 3], + [',', 4], + ['c', 6], +], Strings::split('a, b, c', '#(,)\s*#', PREG_SPLIT_OFFSET_CAPTURE)); diff --git a/tests/Utils/fixtures.reflection/defaultValue.71.php b/tests/Utils/fixtures.reflection/defaultValue.71.php deleted file mode 100644 index 5ea62be92..000000000 --- a/tests/Utils/fixtures.reflection/defaultValue.71.php +++ /dev/null @@ -1,28 +0,0 @@ -