meetup-raffle-winner-picker/tests/FakeEventRepositoryTest.php

35 lines
782 B
PHP
Raw Normal View History

2022-01-13 20:13:28 +00:00
<?php
namespace App\Tests;
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
{
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:22:01 +00:00
/** @test */
public function should_not_return_event_organisers(): void
{
$attendees = $this->repository->getConfirmedAttendees();
2022-01-13 20:18:14 +00:00
$this->assertCount(3, $attendees);
2022-01-13 20:13:28 +00:00
}
}