refactor: use a Collection for attendees

This commit is contained in:
Oliver Davies 2022-01-13 20:22:57 +00:00
parent aec86ad237
commit 133cc8c822

View file

@ -3,17 +3,18 @@
namespace App\Tests; namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Tightenco\Collect\Support\Collection;
final class EventRepositoryTest extends KernelTestCase final class EventRepositoryTest extends KernelTestCase
{ {
/** @test */ /** @test */
public function should_only_return_attendees_with_a_yes_rsvp(): void { public function should_only_return_attendees_with_a_yes_rsvp(): void {
$attendees = [ $attendees = Collection::make([
['name' => 'Matthew Setter'], ['name' => 'Matthew Setter'],
['name' => 'Matthew Setter'], ['name' => 'Matthew Setter'],
['name' => 'Matthew Setter'], ['name' => 'Matthew Setter'],
]; ]);
$this->assertCount(3, $attendees); $this->assertCount(3, $attendees->pluck('name'));
} }
} }