Skip to content

Commit

Permalink
add test for testEnsureAndForceFilter and the new boolean `forceFil…
Browse files Browse the repository at this point in the history
…ter` on `ensure`
  • Loading branch information
fredbradley committed Oct 15, 2024
1 parent d36d242 commit 3d6034c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/Support/SupportCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5515,6 +5515,13 @@ public function testEnsureForMultipleTypes($collection)
$data->ensure([\Throwable::class, 'int']);
}

#[DataProvider('collectionClassProvider')]
public function testEnsureAndForceFilter($collection)
{
$mixture = (new $collection([1, 2, 3, 'string', new stdClass()]))->ensure('int', true);
$this->assertSame([1, 2, 3], $mixture->all());
}

#[DataProvider('collectionClassProvider')]
public function testPercentageWithFlatCollection($collection)
{
Expand Down

0 comments on commit 3d6034c

Please sign in to comment.