diff --git a/tests/FakeEventRepositoryTest.php b/tests/FakeEventRepositoryTest.php index 4462bd8..7511c9f 100644 --- a/tests/FakeEventRepositoryTest.php +++ b/tests/FakeEventRepositoryTest.php @@ -7,12 +7,19 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; final class FakeEventRepositoryTest extends KernelTestCase { + private EventRepository $repository; + + public function setUp(): void + { + self::bootKernel(); + + $this->repository = static::$container->get(EventRepository::class); + } + /** @test */ public function should_only_return_attendees_with_a_yes_rsvp(): void { - $container = self::bootKernel()->getContainer(); - $repository = $container->get(EventRepository::class); - $attendees = $repository->getConfirmedAttendees(); + $attendees = $this->repository->getConfirmedAttendees(); $this->assertCount(3, $attendees->pluck('name')); }