From c71ad2221cae8ebe317a6dc77290b91657c70cc3 Mon Sep 17 00:00:00 2001 From: Evan Shaw Date: Sun, 4 Feb 2024 15:30:36 +1300 Subject: [PATCH] Move Override tests to separate file --- tests/AttributeTest.php | 85 ------------------------------ tests/OverrideTest.php | 111 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 85 deletions(-) create mode 100644 tests/OverrideTest.php diff --git a/tests/AttributeTest.php b/tests/AttributeTest.php index 4a631c5b3..f10517738 100644 --- a/tests/AttributeTest.php +++ b/tests/AttributeTest.php @@ -293,36 +293,6 @@ class AttributeTest extends TestCase 'ignored_issues' => [], 'php_version' => '8.2', ], - 'override' => [ - 'code' => ' [], - 'ignored_issues' => [], - 'php_version' => '8.3', - ], - 'overrideInterface' => [ - 'code' => ' [], - 'ignored_issues' => [], - 'php_version' => '8.3', - ], 'sensitiveParameter' => [ 'code' => ' 'UndefinedAttributeClass - src' . DIRECTORY_SEPARATOR . 'somefile.php:4:36', ], - 'overrideWithNoParent' => [ - 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:3:25', - 'error_levels' => [], - 'php_version' => '8.3', - ], - 'overrideConstructor' => [ - 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:10:25', - 'error_levels' => [], - 'php_version' => '8.3', - ], - 'overridePrivate' => [ - 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:7:25', - 'error_levels' => [], - 'php_version' => '8.3', - ], - 'overrideInterfaceWithNoParent' => [ - 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:3:25', - 'error_levels' => [], - 'php_version' => '8.3', - ], 'tooFewArgumentsToAttributeConstructor' => [ 'code' => ' [ + 'code' => ' [], + 'ignored_issues' => [], + 'php_version' => '8.3', + ], + 'overrideInterface' => [ + 'code' => ' [], + 'ignored_issues' => [], + 'php_version' => '8.3', + ], + ]; + } + + public function providerInvalidCodeParse(): iterable + { + return [ + 'noParent' => [ + 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:3:25', + 'error_levels' => [], + 'php_version' => '8.3', + ], + 'constructor' => [ + 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:10:25', + 'error_levels' => [], + 'php_version' => '8.3', + ], + 'privateMethod' => [ + 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:7:25', + 'error_levels' => [], + 'php_version' => '8.3', + ], + 'interfaceWithNoParent' => [ + 'code' => ' 'InvalidOverride - src' . DIRECTORY_SEPARATOR . 'somefile.php:3:25', + 'error_levels' => [], + 'php_version' => '8.3', + ], + ]; + } +}