refactor: move methods into a contract test trait

This commit is contained in:
Oliver Davies 2022-01-13 22:03:50 +00:00
parent c25104c321
commit 21aa911fb4
2 changed files with 28 additions and 16 deletions

View file

@ -0,0 +1,26 @@
<?php
namespace App\Tests;
use App\EventRepository;
trait EventRepositoryContractTest
{
private EventRepository $repository;
/** @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);
}
}