2022-01-13 20:13:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Tests;
|
|
|
|
|
|
|
|
use App\EventRepository;
|
2022-01-13 20:36:10 +00:00
|
|
|
use Tightenco\Collect\Support\Collection;
|
2022-01-13 20:13:28 +00:00
|
|
|
|
|
|
|
final class FakeEventRepository implements EventRepository
|
|
|
|
{
|
2022-01-13 20:51:14 +00:00
|
|
|
private static array $rsvps = [
|
|
|
|
['name' => 'matthew s.', 'response' => 'yes'],
|
|
|
|
['name' => 'Michael P.', 'response' => 'yes'],
|
|
|
|
['name' => 'Kathryn "Kat" R.', 'response' => 'yes'],
|
|
|
|
['name' => 'Did not attend', 'response' => 'no'],
|
|
|
|
];
|
2022-01-13 20:45:17 +00:00
|
|
|
|
2022-01-13 20:51:14 +00:00
|
|
|
public function getConfirmedAttendees(): Collection {
|
|
|
|
return Collection::make(self::$rsvps)
|
2022-01-13 20:45:17 +00:00
|
|
|
->filter(fn (array $attendee): bool => $attendee['response'] == 'yes')
|
|
|
|
;
|
2022-01-13 20:13:28 +00:00
|
|
|
}
|
|
|
|
}
|