diff --git a/tests/EventRepositoryContractTest.php b/tests/EventRepositoryContractTest.php new file mode 100644 index 0000000..d763d11 --- /dev/null +++ b/tests/EventRepositoryContractTest.php @@ -0,0 +1,26 @@ +repository->getConfirmedAttendees(); + + $this->assertCount(3, $attendees); + } + + /** @test */ + public function should_not_return_event_organisers(): void + { + $attendees = $this->repository->getConfirmedAttendees(); + + $this->assertCount(3, $attendees); + } +} diff --git a/tests/FakeEventRepositoryTest.php b/tests/FakeEventRepositoryTest.php index a18bf13..2c68065 100644 --- a/tests/FakeEventRepositoryTest.php +++ b/tests/FakeEventRepositoryTest.php @@ -7,6 +7,8 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; final class FakeEventRepositoryTest extends KernelTestCase { + use EventRepositoryContractTest; + private EventRepository $repository; public function setUp(): void @@ -15,20 +17,4 @@ final class FakeEventRepositoryTest extends KernelTestCase $this->repository = static::$container->get(EventRepository::class); } - - /** @test */ - public function should_only_return_attendees_with_a_yes_rsvp(): void - { - $attendees = $this->repository->getConfirmedAttendees(); - - $this->assertCount(3, $attendees); - } - - /** @test */ - public function should_not_return_event_organisers(): void - { - $attendees = $this->repository->getConfirmedAttendees(); - - $this->assertCount(3, $attendees); - } }