Skip to content

Commit

Permalink
Return null for empty segment sets
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Wanyoike committed Apr 15, 2021
1 parent 7712dc9 commit ca00fcb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/unit/SegmentSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,12 @@ public function testFirst()
$actual = $segments->first();
self::assertTrue($actual->equals($price));
}

public function testFirstWithEmptySegmentSet()
{
$segments = SegmentSet::of([]);

$actual = $segments->first();
self::assertNull($actual);
}
}

0 comments on commit ca00fcb

Please sign in to comment.