Skip to content

Commit

Permalink
Remove duplicated step
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Dec 12, 2023
1 parent 1c75cc3 commit 72236ab
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@

namespace Sylius\Behat\Context\Api\Admin;

use ApiPlatform\Api\IriConverterInterface;
use Behat\Behat\Context\Context;
use Sylius\Behat\Client\ApiClientInterface;
use Sylius\Behat\Client\ResponseCheckerInterface;
use Sylius\Behat\Context\Api\Resources;
use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Webmozart\Assert\Assert;

Expand All @@ -27,24 +25,9 @@ final class BrowsingProductVariantsContext implements Context
public function __construct (
private ApiClientInterface $client,
private ResponseCheckerInterface $responseChecker,
private IriConverterInterface $iriConverter,
) {
}

/**
* @When I view all variants of the product :product
*/
public function iViewAllVariantsOfTheProduct(ProductInterface $product): void
{
$this->client->index(
Resources::PRODUCT_VARIANTS,
[
'product' => $this->iriConverter->getIriFromResource($product),
'order[position]' => 'asc',
],
);
}

/**
* @When I start sorting variants by position
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public function iWantToViewAllVariantsOfThisProduct(ProductInterface $product):
{
$this->client->index(Resources::PRODUCT_VARIANTS);
$this->client->addFilter('product', $this->iriConverter->getIriFromResource($product));
$this->client->addFilter('order[position]', 'asc');
$this->client->filter();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<service id="Sylius\Behat\Context\Api\Admin\BrowsingProductVariantsContext">
<argument type="service" id="sylius.behat.api_platform_client.admin" />
<argument type="service" id="Sylius\Behat\Client\ResponseCheckerInterface" />
<argument type="service" id="api_platform.iri_converter" />
</service>

<service id="Sylius\Behat\Context\Api\Admin\CreatingProductVariantContext">
Expand Down

0 comments on commit 72236ab

Please sign in to comment.