2022-01-13 22:03:50 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Tests;
|
|
|
|
|
|
|
|
use App\EventRepository;
|
|
|
|
|
|
|
|
trait EventRepositoryContractTest
|
|
|
|
{
|
|
|
|
private EventRepository $repository;
|
|
|
|
|
|
|
|
/** @test */
|
|
|
|
public function should_only_return_attendees_with_a_yes_rsvp(): void
|
|
|
|
{
|
2022-01-14 00:14:08 +00:00
|
|
|
$attendees = $this->repository->findAttendeesForEvent();
|
2022-01-13 22:03:50 +00:00
|
|
|
|
2022-01-13 23:06:25 +00:00
|
|
|
$this->assertFalse($attendees->pluck('is_attending')->contains(false));
|
2022-01-13 22:03:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** @test */
|
|
|
|
public function should_not_return_event_organisers(): void
|
|
|
|
{
|
2022-01-14 00:14:08 +00:00
|
|
|
$attendees = $this->repository->findAttendeesForEvent();
|
2022-01-13 22:03:50 +00:00
|
|
|
|
2022-01-13 23:26:42 +00:00
|
|
|
$this->assertSame([false], $attendees->pluck('is_host')->unique()->toArray());
|
2022-01-13 22:03:50 +00:00
|
|
|
}
|
|
|
|
}
|