From fa56cf6908899dc1092d966d582d84cefab02d6f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 14 Feb 2019 08:11:09 +0000 Subject: [PATCH] Ensure that the winners are comments --- tests/Service/PickerTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Service/PickerTest.php b/tests/Service/PickerTest.php index 0870676..f12c3ea 100644 --- a/tests/Service/PickerTest.php +++ b/tests/Service/PickerTest.php @@ -2,6 +2,7 @@ namespace App\Tests\Service; +use App\Comment; use App\Service\Picker; use PHPUnit\Framework\TestCase; use Tightenco\Collect\Support\Collection; @@ -125,12 +126,17 @@ class PickerTest extends TestCase tap($picker->getWinners(1), function (Collection $winners) use ($picker) { $this->assertCount(1, $winners); + $this->assertInstanceOf(Comment::class, $winners->first()); $this->assertTrue($picker->getComments()->contains($winners->first())); }); tap($picker->getWinners(2), function (Collection $winners) use ($picker) { $this->assertCount(2, $winners); + + $this->assertInstanceOf(Comment::class, $winners->first()); $this->assertTrue($picker->getComments()->contains($winners->first())); + + $this->assertInstanceOf(Comment::class, $winners->last()); $this->assertTrue($picker->getComments()->contains($winners->last())); }); }