Skip to content

Commit 0a3130e

Browse files
committed
[WIP]OP-289: Bump min required patches
1 parent a5e8a36 commit 0a3130e

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

.docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:20.04
22
ARG DEBIAN_FRONTEND=noninteractive
3-
ARG PHP_VERSION=8.1
3+
ARG PHP_VERSION=8.2
44
ENV LC_ALL=C.UTF-8
55

66
# Install basic tools

features/having_bundled_product_in_store.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ Feature: Having a product in store which is a bundle of other products
7171
When I pick up my cart
7272
And I add bundle "Jim Beam&Coke" with quantity 5 to my cart and overwrite "JIM_BEAM" with "JIM_BEAM_1L"
7373
Then I should have bundle "Jim Beam&Coke" with quantity 5 in my cart
74-
And I should have product variant "Jim Beam 1L" in bundled items
75-
And I should not have product variant "Jim Beam" in bundled items
74+
And I should have product variant "JIM_BEAM_1L" in bundled items
75+
And I should not have product variant "JIM_BEAM" in bundled items
7676
And I should have product "Coca-Cola" in bundled items
7777

7878
@api
7979
Scenario: Adding unpacked product bundles to cart and overwriting variants with invalid variant with API
8080
When I pick up my cart
8181
And I add bundle "Jim Beam&Coke" with quantity 5 to my cart and overwrite "COCA_COLA" with "JIM_BEAM_1L"
8282
Then I should have bundle "Jim Beam&Coke" with quantity 5 in my cart
83-
And I should not have product variant "Jim Beam 1L" in bundled items
84-
And I should have product variant "Jim Beam" in bundled items
83+
And I should not have product variant "JIM_BEAM_1L" in bundled items
84+
And I should have product variant "JIM_BEAM" in bundled items
8585
And I should have product "Coca-Cola" in bundled items
8686

8787
@api
@@ -90,6 +90,6 @@ Feature: Having a product in store which is a bundle of other products
9090
When I pick up my cart
9191
And I add bundle "Jim Beam&Coke" with quantity 5 to my cart and overwrite "JIM_BEAM" with "JIM_BEAM_1L"
9292
Then I should have bundle "Jim Beam&Coke" with quantity 5 in my cart
93-
And I should not have product variant "Jim Beam 1L" in bundled items
94-
And I should have product variant "Jim Beam" in bundled items
93+
And I should not have product variant "JIM_BEAM_1L" in bundled items
94+
And I should have product variant "JIM_BEAM" in bundled items
9595
And I should have product "Coca-Cola" in bundled items

tests/Behat/Context/Api/ProductBundleContext.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Sylius\Behat\Context\Api\Resources;
2121
use Sylius\Behat\Service\SharedStorageInterface;
2222
use Sylius\Component\Core\Model\ProductVariantInterface;
23+
use Sylius\Component\Core\Repository\ProductVariantRepositoryInterface;
2324
use Symfony\Component\HttpFoundation\Request as HttpRequest;
2425
use Webmozart\Assert\Assert;
2526

@@ -30,6 +31,7 @@ public function __construct(
3031
private readonly ApiClientInterface $client,
3132
private readonly RequestFactoryInterface $requestFactory,
3233
private readonly ResponseCheckerInterface $responseChecker,
34+
private readonly ProductVariantRepositoryInterface $productVariantRepository,
3335
) {
3436
}
3537

@@ -116,8 +118,11 @@ public function iShouldHaveProductInBundledItems(ProductInterface $product): voi
116118
/**
117119
* @When I should have product variant :productVariant in bundled items
118120
*/
119-
public function iShouldHaveProductVariantInBundledItems(ProductVariantInterface $productVariant): void
121+
public function iShouldHaveProductVariantInBundledItems(string $productVariant): void
120122
{
123+
$productVariant = $this->productVariantRepository->findOneBy(['code' => $productVariant]);
124+
Assert::isInstanceOf($productVariant, ProductVariantInterface::class);
125+
121126
$response = $this->client->show(Resources::ORDERS, $this->sharedStorage->get('cart_token'));
122127

123128
$productBundleOrderItems = $this->responseChecker->getValue($response, 'items')[0]['productBundleOrderItems'];
@@ -133,8 +138,11 @@ public function iShouldHaveProductVariantInBundledItems(ProductVariantInterface
133138
/**
134139
* @When I should not have product variant :productVariant in bundled items
135140
*/
136-
public function iShouldNotHaveProductVariantInBundledItems(ProductVariantInterface $productVariant): void
141+
public function iShouldNotHaveProductVariantInBundledItems(string $productVariant): void
137142
{
143+
$productVariant = $this->productVariantRepository->findOneBy(['code' => $productVariant]);
144+
Assert::isInstanceOf($productVariant, ProductVariantInterface::class);
145+
138146
$response = $this->client->show(Resources::ORDERS, $this->sharedStorage->get('cart_token'));
139147

140148
$productBundleOrderItems = $this->responseChecker->getValue($response, 'items')[0]['productBundleOrderItems'];

tests/Behat/Resources/services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ services:
5353
- '@sylius.behat.api_platform_client.shop'
5454
- '@sylius.behat.request_factory'
5555
- '@Sylius\Behat\Client\ResponseCheckerInterface'
56+
- '@sylius.repository.product_variant'

tests/Behat/Resources/suites.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ default:
9393
- sylius.behat.context.transform.locale
9494
- sylius.behat.context.transform.payment
9595
- sylius.behat.context.transform.product
96-
- sylius.behat.context.transform.product_variant
9796
- sylius.behat.context.transform.promotion
9897
- sylius.behat.context.transform.shared_storage
9998
- sylius.behat.context.transform.shipping_method
@@ -102,7 +101,6 @@ default:
102101

103102
- sylius.behat.context.api.shop.cart
104103
- sylius.behat.context.api.shop.checkout
105-
- sylius.behat.context.api.shop.checkout.complete
106104

107105
- bitbag_sylius_product_bundle_plugin.behat.context.api.product_bundle
108106
- bitbag_sylius_product_bundle_plugin.behat.context.setup.product_bundle

0 commit comments

Comments
 (0)