From 48bb62f9e883aab02fa042ee413b76cd0390baeb Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 6 Dec 2024 15:01:49 +0100 Subject: [PATCH] more tests --- .../Fixture/plain-call-custom-method.php | 16 ++++++++++++++++ .../UnusedPublicClassMethodRuleTest.php | 1 + 2 files changed, 17 insertions(+) create mode 100644 tests/Rules/UnusedPublicClassMethodRule/Fixture/plain-call-custom-method.php diff --git a/tests/Rules/UnusedPublicClassMethodRule/Fixture/plain-call-custom-method.php b/tests/Rules/UnusedPublicClassMethodRule/Fixture/plain-call-custom-method.php new file mode 100644 index 0000000..1b2ddbd --- /dev/null +++ b/tests/Rules/UnusedPublicClassMethodRule/Fixture/plain-call-custom-method.php @@ -0,0 +1,16 @@ +myMethod([$caller1, 'callIt']); + +class MyClass { + function myMethod(callable $c) {} +} diff --git a/tests/Rules/UnusedPublicClassMethodRule/UnusedPublicClassMethodRuleTest.php b/tests/Rules/UnusedPublicClassMethodRule/UnusedPublicClassMethodRuleTest.php index a9b7531..7a6a454 100644 --- a/tests/Rules/UnusedPublicClassMethodRule/UnusedPublicClassMethodRuleTest.php +++ b/tests/Rules/UnusedPublicClassMethodRule/UnusedPublicClassMethodRuleTest.php @@ -176,6 +176,7 @@ public static function provideData(): Iterator yield [[__DIR__ . '/Fixture/plain-call-user-func.php', __DIR__ . '/Source/Caller1.php'], []]; yield [[__DIR__ . '/Fixture/plain-call-shutdown-function.php', __DIR__ . '/Source/Caller1.php'], []]; yield [[__DIR__ . '/Fixture/plain-call-custom-function.php', __DIR__ . '/Source/Caller1.php'], []]; + yield [[__DIR__ . '/Fixture/plain-call-custom-method.php', __DIR__ . '/Source/Caller1.php'], []]; yield [[__DIR__ . '/Fixture/SkipCrashBug89.php.inc'], []]; yield [[__DIR__ . '/Fixture/SkipJsonSerialize.php'], []];