From 8a20466f9a7001568784d9756374259dcd9eb1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 6 Jan 2025 09:53:27 +0100 Subject: [PATCH] Fix: Add test case for anonymous class --- test/Integration/Methods/PrivateInFinalClassRuleTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/Integration/Methods/PrivateInFinalClassRuleTest.php b/test/Integration/Methods/PrivateInFinalClassRuleTest.php index ec0d4d40..41436b14 100644 --- a/test/Integration/Methods/PrivateInFinalClassRuleTest.php +++ b/test/Integration/Methods/PrivateInFinalClassRuleTest.php @@ -47,6 +47,13 @@ public static function provideCasesWhereAnalysisShouldSucceed(): iterable public static function provideCasesWhereAnalysisShouldFail(): iterable { $paths = [ + 'anonymous-class-with-protected-method' => [ + __DIR__ . '/../../Fixture/Methods/PrivateInFinalClassRule/Failure/AnonymousClassWithProtectedMethod.php', + [ + 'Method method() in anonymous class is protected, but since the containing class is final, it can be private.', + 8, + ], + ], 'final-class-with-protected-method' => [ __DIR__ . '/../../Fixture/Methods/PrivateInFinalClassRule/Failure/FinalClassWithProtectedMethod.php', [