Skip to content

Commit

Permalink
Update SubsetFinderTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
n1crack committed Feb 8, 2024
1 parent 2099ca4 commit 197a485
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/SubsetFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Ozdemir\SubsetFinder\SubsetCollection;
use Ozdemir\SubsetFinder\SubsetFinder;

it('can find subsets in a collection', function() {
it('can find subsets in a collection', function () {
$collection = collect([
$this->mockSubsetable(id: 1, quantity: 11, price: 15),
$this->mockSubsetable(id: 2, quantity: 6, price: 5),
Expand Down Expand Up @@ -38,11 +38,10 @@
2 => 6,
1 => 9,
3 => 6,
])
;
]);
});

it('can find subsets in a collection with different field names', function() {
it('can find subsets in a collection with different field names', function () {
$collection = collect([
$this->mockSubsetableAlt(1, 11, 15),
$this->mockSubsetableAlt(2, 6, 5),
Expand All @@ -69,7 +68,7 @@
]);
});

it('returns blank if it doesnt find anything', function() {
it('returns blank if it doesnt find anything', function () {
$collection = collect([
$this->mockSubsetable(1, 11, 15),
$this->mockSubsetable(2, 6, 5),
Expand All @@ -94,7 +93,7 @@
->and($this->convertToArray($subsetFinder->getRemaining()))->toBe($this->convertToArray($collection));
});

it('can cover all items in the collection ', function() {
it('can cover all items in the collection ', function () {
$collection = collect([
$this->mockSubsetable(1, 11, 15),
$this->mockSubsetable(2, 6, 5),
Expand Down Expand Up @@ -123,7 +122,7 @@
->and($this->convertToArray($subsetFinder->getRemaining()))->toBe([]);
});

it('can have multiple items from the collection to look up', function() {
it('can have multiple items from the collection to look up', function () {
$collection = collect([
$this->mockSubsetable(1, 11, 15),
$this->mockSubsetable(2, 6, 5),
Expand All @@ -149,7 +148,7 @@
->and($this->convertToArray($subsetFinder->getRemaining()))->toBe([]);
});

it('can have a single item in the setCollections ', function() {
it('can have a single item in the setCollections ', function () {
$collection = collect([
$this->mockSubsetable(1, 11, 15),
$this->mockSubsetable(2, 6, 5),
Expand Down Expand Up @@ -184,7 +183,7 @@
]);
});

it('can get n many items as ordered', function() {
it('can get n many items as ordered', function () {
$collection = collect([
$this->mockSubsetable(1, 11, 15),
$this->mockSubsetable(2, 6, 5),
Expand Down Expand Up @@ -218,7 +217,7 @@
});


it('can get the subsets with large number of sets', function() {
it('can get the subsets with large number of sets', function () {
$collection = collect([
$this->mockSubsetable(1, 2500, 15),
$this->mockSubsetable(2, 2000, 5),
Expand Down

0 comments on commit 197a485

Please sign in to comment.