2022-01-13 20:13:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Tests;
|
|
|
|
|
2022-01-13 21:02:13 +00:00
|
|
|
use App\EventRepository;
|
2022-01-13 20:13:28 +00:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|
|
|
|
2022-01-13 20:29:32 +00:00
|
|
|
final class FakeEventRepositoryTest extends KernelTestCase
|
2022-01-13 20:13:28 +00:00
|
|
|
{
|
2022-01-13 21:06:46 +00:00
|
|
|
private EventRepository $repository;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
self::bootKernel();
|
|
|
|
|
|
|
|
$this->repository = static::$container->get(EventRepository::class);
|
|
|
|
}
|
|
|
|
|
2022-01-13 20:13:28 +00:00
|
|
|
/** @test */
|
2022-01-13 21:21:26 +00:00
|
|
|
public function should_only_return_attendees_with_a_yes_rsvp(): void
|
|
|
|
{
|
2022-01-13 21:22:01 +00:00
|
|
|
$attendees = $this->repository->getConfirmedAttendees();
|
|
|
|
|
|
|
|
$this->assertCount(3, $attendees);
|
|
|
|
}
|
2022-01-13 21:02:13 +00:00
|
|
|
|
2022-01-13 21:22:01 +00:00
|
|
|
/** @test */
|
|
|
|
public function should_not_return_event_organisers(): void
|
|
|
|
{
|
2022-01-13 21:06:46 +00:00
|
|
|
$attendees = $this->repository->getConfirmedAttendees();
|
2022-01-13 20:18:14 +00:00
|
|
|
|
2022-01-13 21:15:02 +00:00
|
|
|
$this->assertCount(3, $attendees);
|
2022-01-13 20:13:28 +00:00
|
|
|
}
|
|
|
|
}
|