refactor: rename method
This commit is contained in:
parent
767c6f2ced
commit
8fe80b8992
|
@ -6,5 +6,5 @@ use Tightenco\Collect\Support\Collection;
|
||||||
|
|
||||||
interface EventRepository
|
interface EventRepository
|
||||||
{
|
{
|
||||||
public function getConfirmedAttendees(): Collection;
|
public function findAttendeesForEvent(): Collection;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ final class MeetupEventRepository implements EventRepository
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfirmedAttendees(): Collection
|
public function findAttendeesForEvent(): Collection
|
||||||
{
|
{
|
||||||
$response = $this->client->request('GET', 'https://api.meetup.com/php-south-wales/events/282265786/rsvps');
|
$response = $this->client->request('GET', 'https://api.meetup.com/php-south-wales/events/282265786/rsvps');
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ trait EventRepositoryContractTest
|
||||||
/** @test */
|
/** @test */
|
||||||
public function should_only_return_attendees_with_a_yes_rsvp(): void
|
public function should_only_return_attendees_with_a_yes_rsvp(): void
|
||||||
{
|
{
|
||||||
$attendees = $this->repository->getConfirmedAttendees();
|
$attendees = $this->repository->findAttendeesForEvent();
|
||||||
|
|
||||||
$this->assertFalse($attendees->pluck('is_attending')->contains(false));
|
$this->assertFalse($attendees->pluck('is_attending')->contains(false));
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ trait EventRepositoryContractTest
|
||||||
/** @test */
|
/** @test */
|
||||||
public function should_not_return_event_organisers(): void
|
public function should_not_return_event_organisers(): void
|
||||||
{
|
{
|
||||||
$attendees = $this->repository->getConfirmedAttendees();
|
$attendees = $this->repository->findAttendeesForEvent();
|
||||||
|
|
||||||
$this->assertSame([false], $attendees->pluck('is_host')->unique()->toArray());
|
$this->assertSame([false], $attendees->pluck('is_host')->unique()->toArray());
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ final class FakeEventRepository implements EventRepository
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfirmedAttendees(): Collection
|
public function findAttendeesForEvent(): Collection
|
||||||
{
|
{
|
||||||
return Collection::make(self::$rsvps)
|
return Collection::make(self::$rsvps)
|
||||||
->filter(fn (\stdClass $attendee): bool => $attendee->is_attending)
|
->filter(fn (\stdClass $attendee): bool => $attendee->is_attending)
|
||||||
|
|
Loading…
Reference in a new issue