From e54d57a322a9377c3ed7dc62c66abdc48973b95a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 14 Feb 2019 00:30:21 +0000 Subject: [PATCH] Tidying --- tests/Service/PickerTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Service/PickerTest.php b/tests/Service/PickerTest.php index 34341e8..338702c 100644 --- a/tests/Service/PickerTest.php +++ b/tests/Service/PickerTest.php @@ -29,10 +29,10 @@ class PickerTest extends TestCase ], ]; - $picker = new Picker(); - $picker->setHosts(collect($data)); + $hosts = (new Picker()) + ->setHosts(collect($data)) + ->getHosts(); - $hosts = $picker->getHosts(); $this->assertInstanceOf(Collection::class, $hosts); $this->assertCount(5, $hosts); } @@ -40,7 +40,7 @@ class PickerTest extends TestCase /** @test */ public function comments_for_multiple_events_are_flattened_and_combined() { - $comments = [ + $data = [ [ [ 'comment' => 'Great talk!', @@ -59,12 +59,12 @@ class PickerTest extends TestCase ], ]; - $picker = new Picker(); - $picker->setComments(collect($comments)); + $comments = (new Picker()) + ->setComments(collect($data)) + ->getComments(); - $result = $picker->getComments(); - $this->assertInstanceOf(Collection::class, $result); - $this->assertCount(3, $result); + $this->assertInstanceOf(Collection::class, $comments); + $this->assertCount(3, $comments); } /** @test */