Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"phpunit/phpunit": "^9.6.17 || ^10.0 || ^11.0 || ^12.0",
"php-http/message": "^1.0 || ^2.0",
"guzzlehttp/psr7": "^1.9 || ^2.0 || ^3.0",
"th3n3rd/cartesian-product": "^0.3"
"th3n3rd/cartesian-product": "^0.3 || ^1.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to not simply restrict to the 1.0 version? does 0.3 support older dependencies than 1.0?

},
"suggest": {
"php-http/httplug": "To test async client"
Expand Down
20 changes: 16 additions & 4 deletions src/HttpBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ public static function requestProvider(): array
'body' => self::getBodies(),
];

$cartesianProduct = new CartesianProduct($sets);
if (method_exists(CartesianProduct::class, 'of')) {
$cartesianProduct = CartesianProduct::of($sets);

$cases = $cartesianProduct->compute();
$cases = $cartesianProduct->toArray();
} else {
$cartesianProduct = new CartesianProduct($sets);

$cases = $cartesianProduct->compute();
}

// Filter all TRACE requests with a body, as they're not HTTP spec compliant
return array_filter($cases, function ($case) {
Expand All @@ -81,9 +87,15 @@ public static function requestWithOutcomeProvider(): array
'body' => self::getBodies(),
];

$cartesianProduct = new CartesianProduct($sets);
if (method_exists(CartesianProduct::class, 'of')) {
$cartesianProduct = CartesianProduct::of($sets);

return $cartesianProduct->compute();
return $cartesianProduct->toArray();
} else {
$cartesianProduct = new CartesianProduct($sets);

return $cartesianProduct->compute();
}
}

private static function getMethods(): array
Expand Down