From c32caffed87bccef69aa7356bdef4c7d4117dceb Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Mon, 6 Jan 2025 13:44:00 -0500 Subject: [PATCH] Fix tests --- tests/ReflectionTest.php | 4 ++++ tests/StructureDiscovererTest.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/ReflectionTest.php b/tests/ReflectionTest.php index 82e103b..4cc9584 100644 --- a/tests/ReflectionTest.php +++ b/tests/ReflectionTest.php @@ -21,6 +21,8 @@ use Spatie\StructureDiscoverer\Tests\Fakes\FakeSubChildClass; use Spatie\StructureDiscoverer\Tests\Fakes\FakeSubChildInterface; use Spatie\StructureDiscoverer\Tests\Fakes\FakeTrait; +use Spatie\StructureDiscoverer\Tests\Fakes\FakeWithAnonymousClass; +use Spatie\StructureDiscoverer\Tests\Fakes\FakeWithMultipleClasses; use Spatie\StructureDiscoverer\Tests\Fakes\Nested\FakeNestedClass; use Spatie\StructureDiscoverer\Tests\Fakes\Nested\FakeNestedInterface; use Spatie\StructureDiscoverer\Tests\Fakes\OtherNested\FakeOtherNestedClass; @@ -116,7 +118,9 @@ FakeOtherNestedClass::class, FakeSubChildInterface::class, FakeSubChildClass::class, + FakeWithMultipleClasses::class, FakeClassDepender::class, FakeInterfaceDepender::class, + FakeWithAnonymousClass::class, ]); }); diff --git a/tests/StructureDiscovererTest.php b/tests/StructureDiscovererTest.php index b5fc740..5819f2e 100644 --- a/tests/StructureDiscovererTest.php +++ b/tests/StructureDiscovererTest.php @@ -83,6 +83,9 @@ FakeOtherNestedClass::class, FakeSubChildClass::class, FakeClassDepender::class, + FakeWithAnonymousClass::class, + FakeWithMultipleClasses::class, + FakeWithMultipleClassesSub::class, ], ], 'interfaces' => [ @@ -508,7 +511,7 @@ public function satisfies(DiscoveredStructure $discoveredData): bool }); it('can discover enums with interfaces', function () { - $found = Discover::in(__DIR__.'/Fakes') + $found = Discover::in(__DIR__ . '/Fakes') ->implementing(FakeChildInterface::class) ->enums() ->get(); @@ -518,6 +521,7 @@ public function satisfies(DiscoveredStructure $discoveredData): bool FakeStringEnum::class, FakeIntEnum::class, ]); +}); it('can parse anonymous classes', function () { $found = Discover::in(__DIR__ . '/Fakes')->get();