refactor: get the repository from the container
This commit is contained in:
parent
78841ad9d6
commit
bc747a1f70
3 changed files with 17 additions and 6 deletions
|
@ -2,13 +2,16 @@
|
|||
|
||||
namespace App\Tests;
|
||||
|
||||
use App\EventRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
final class FakeEventRepositoryTest extends KernelTestCase
|
||||
{
|
||||
/** @test */
|
||||
public function should_only_return_attendees_with_a_yes_rsvp(): void {
|
||||
$repository = new FakeEventRepository();
|
||||
$container = self::bootKernel()->getContainer();
|
||||
$repository = $container->get(EventRepository::class);
|
||||
|
||||
$attendees = $repository->getConfirmedAttendees();
|
||||
|
||||
$this->assertCount(3, $attendees->pluck('name'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue