Convert Behat annotations to PHP attributes in Api Shop contexts#18826
Conversation
📝 WalkthroughWalkthroughMigrates Behat step declarations in ~20 Shop API context classes from PHPDoc annotations to PHP 8 attributes (#[Given]/#[When]/#[Then]). Preserves method signatures and most control flow; notable behavioral edits in AddressContext (default-address update), ProductVariantContext (immediate filter call), LoginContext and RegistrationContext flows. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
❗ Preview Environment delete from Bunnyshell failedCheck https://github.com/Sylius/Sylius/actions/runs/22101627609 for details. See: Environment Details Available commands:
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/Sylius/Behat/Context/Api/Shop/AddressContext.php (1)
122-130:⚠️ Potential issue | 🟡 MinorThe behavioral change is intentional and tested.
This method correctly uses
Resources::CUSTOMERSwith thedefaultAddressfield to set the default address, which is consistent with how the same data is read inaddressShouldBeMarkedAsMyDefaultAddress()(line 271) andiShouldHaveNoDefaultAddress()(line 323). The feature filesetting_default_address.featurecontains scenarios that exercise this step.However, the import ordering on lines 16-19 violates the coding guidelines. Imports should be sorted alphabetically; currently
Behat\Step\Given,Behat\Step\When, andBehat\Step\Thenappear beforeBehat\Behat\Context\Context, which should come first alphabetically.src/Sylius/Behat/Context/Api/Shop/ProductContext.php (1)
375-383:⚠️ Potential issue | 🟡 MinorChange
#[When]to#[Then]on line 375.The step
I should see only (\d+) product(s)is an assertion step that matches the semantic pattern of other "I should see" steps in this file (all marked#[Then]). The method contains only assertions and no actions, confirming it should use the#[Then]attribute.Fix
- #[When('/^I should see only (\d+) product(s)$/')] + #[Then('/^I should see only (\d+) product(s)$/')]
🤖 Fix all issues with AI agents
In `@src/Sylius/Behat/Context/Api/Shop/AddressContext.php`:
- Around line 313-318: The step handler iShouldStillHaveAsMySpecifiedProvince
currently only checks that the update failed but ignores the $provinceName
parameter; update it to first assert the update was unsuccessful (keep
Assert::false($this->responseChecker->isUpdateSuccessful($this->client->getLastResponse()))),
then fetch the current address representation (e.g. obtain the response content
for the address resource from $this->client->getLastResponse() or re-fetch the
address via the shop API) and assert that the province field/value in that
representation equals $provinceName (use the existing responseChecker helpers or
Assert::same/equals to compare the province value to $provinceName) so the step
verifies the actual province remains unchanged.
In `@src/Sylius/Behat/Context/Api/Shop/CheckoutContext.php`:
- Around line 1110-1114: The step definition attribute on method
iShouldSeeWithUnitPrice is incorrect: change the attribute from #[When('/^I
should see (product "[^"]+") with unit price ("[^"]+")$/')] to #[Then(...)] so
the assertion step is bound as a Then step; update the attribute on the
iShouldSeeWithUnitPrice(ProductInterface $product, int $unitPrice): void method
in CheckoutContext to use #[Then] with the same regex pattern (no other code
changes needed).
In `@src/Sylius/Behat/Context/Api/Shop/HomepageContext.php`:
- Around line 16-19: Reorder the PHP use statements so imports are alphabetized
and grouped by type: move ApiPlatform\Metadata\IriConverterInterface before
Behat\Step\Then and Behat\Step\When, and ensure Then comes before When; keep
Behat\Behat\Context\Context in the correct group as well. Adjust the import
block containing Context, IriConverterInterface, Then, and When to follow
alphabetical order (Context, IriConverterInterface, Then, When) so the use list
in HomepageContext.php complies with the project's import-sorting rules.
🧹 Nitpick comments (10)
src/Sylius/Behat/Context/Api/Shop/CurrencyContext.php (1)
16-17: Imports are not sorted alphabetically.
Thenshould come beforeWhento comply with the alphabetical ordering convention.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Behat/Context/Api/Shop/ShipmentContext.php (1)
16-17: Import order:Thenshould precedeWhenalphabetically.Per coding guidelines,
useimports should be sorted alphabetically.Behat\Step\Thenshould come beforeBehat\Step\When.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Behat/Context/Api/Shop/ProductAttributeContext.php (1)
16-17: Import order:Behat\Step\Thenshould come afterBehat\Behat\Context\Context.
Behat\Behat\…sorts beforeBehat\Step\…alphabetically.Proposed fix
-use Behat\Step\Then; use Behat\Behat\Context\Context; +use Behat\Step\Then;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)."src/Sylius/Behat/Context/Api/Shop/OrderItemContext.php (1)
16-17: Imports are not sorted alphabetically.
Behat\Step\Thenshould come beforeBehat\Step\When. Additionally, these should be grouped with the otherBehat\import on line 18 for consistent ordering. As per coding guidelines,useimports should be sorted alphabetically and grouped by type.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php (1)
16-17: Imports are not sorted alphabetically.
Behat\Step\WhenandBehat\Step\Thenare placed beforeApiPlatform\Metadata\IriConverterInterfaceand are themselves in the wrong relative order (WhenbeforeThen). As per coding guidelines,useimports should be sorted alphabetically.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; use ApiPlatform\Metadata\IriConverterInterface; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When; use Sylius\Behat\Client\ApiClientInterface;src/Sylius/Behat/Context/Api/Shop/PaymentRequestContext.php (1)
16-18: Reorder use statements alphabetically.The newly added use statements should be sorted alphabetically. Currently,
Behat\Step\WhenandBehat\Step\Thenappear beforeBehat\Behat\Context\Context, but alphabeticallyBehat\Behat\...should come first. Additionally,Thenshould precedeWhen. As per coding guidelines, use imports must be sorted alphabetically.♻️ Proposed fix to reorder use statements
-use Behat\Step\When; -use Behat\Step\Then; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;src/Sylius/Behat/Context/Api/Shop/LoginContext.php (1)
166-168: Consider adding missing: voidreturn type oniLogOut.While the attribute conversion on lines 166–167 is correct, the method on line 168 is missing a
: voidreturn type declaration. This is pre-existing but worth addressing in this cleanup pass. As per coding guidelines, "Add type declarations for all properties, arguments, and return values in PHP code."Suggested fix
#[When('I log out')] #[When('the customer logged out')] - public function iLogOut() + public function iLogOut(): void {src/Sylius/Behat/Context/Api/Shop/CustomerContext.php (1)
16-18: Imports are not sorted alphabetically.
Behat\Behat\Context\Contextshould come beforeBehat\Step\*, andBehat\Step\ThenbeforeBehat\Step\When. This ordering issue is consistent across all files in this PR.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)."src/Sylius/Behat/Context/Api/Shop/TaxonContext.php (1)
16-19: Imports are not sorted alphabetically.
ApiPlatform\Metadata\IriConverterInterface(line 18) should precede allBehat\*imports, andBehat\Behat\Context\Contextshould come beforeBehat\Step\*.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; use ApiPlatform\Metadata\IriConverterInterface; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)."src/Sylius/Behat/Context/Api/Shop/OrderContext.php (1)
16-17: Imports are not sorted alphabetically.
Behat\Step\WhenandBehat\Step\Thenare placed beforeApiPlatform\Metadata\IriConverterInterface, violating the alphabetical import ordering. This same pattern repeats across all files in this PR.Suggested fix
-use Behat\Step\When; -use Behat\Step\Then; use ApiPlatform\Metadata\IriConverterInterface; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".
| #[Then('I should still have :provinceName as my specified province')] | ||
| #[Then('I should still have :provinceName as my chosen province')] | ||
| public function iShouldStillHaveAsMySpecifiedProvince(string $provinceName): void | ||
| { | ||
| Assert::false($this->responseChecker->isUpdateSuccessful($this->client->getLastResponse())); | ||
| } |
There was a problem hiding this comment.
$provinceName parameter is not used in the assertion.
The static analysis hint is valid here. The method checks that the update was unsuccessful but never verifies the province name matches $provinceName. This means the step I should still have :provinceName as my specified province would pass regardless of the actual province value, as long as the last request failed. This is likely a pre-existing issue.
🧰 Tools
🪛 PHPMD (2.15.0)
[warning] 315-315: Avoid unused parameters such as '$provinceName'. (undefined)
(UnusedFormalParameter)
🤖 Prompt for AI Agents
In `@src/Sylius/Behat/Context/Api/Shop/AddressContext.php` around lines 313 - 318,
The step handler iShouldStillHaveAsMySpecifiedProvince currently only checks
that the update failed but ignores the $provinceName parameter; update it to
first assert the update was unsuccessful (keep
Assert::false($this->responseChecker->isUpdateSuccessful($this->client->getLastResponse()))),
then fetch the current address representation (e.g. obtain the response content
for the address resource from $this->client->getLastResponse() or re-fetch the
address via the shop API) and assert that the province field/value in that
representation equals $provinceName (use the existing responseChecker helpers or
Assert::same/equals to compare the province value to $provinceName) so the step
verifies the actual province remains unchanged.
| #[When('/^I should see (product "[^"]+") with unit price ("[^"]+")$/')] | ||
| public function iShouldSeeWithUnitPrice(ProductInterface $product, int $unitPrice): void | ||
| { | ||
| Assert::true($this->hasProductWithUnitPrice($product->getName(), $unitPrice)); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
rg -n "should see product .* with unit price" --type-add 'feature:*.feature' --type feature -C1Repository: Sylius/Sylius
Length of output: 442
Change #[When] to #[Then] for assertion step.
The step "I should see product ... with unit price ..." is semantically an assertion and is used in feature files following a Then keyword (as And I should see...). It should be bound with the #[Then] attribute.
Suggested fix
- #[When('/^I should see (product "[^"]+") with unit price ("[^"]+")$/')]
+ #[Then('/^I should see (product "[^"]+") with unit price ("[^"]+")$/')]🤖 Prompt for AI Agents
In `@src/Sylius/Behat/Context/Api/Shop/CheckoutContext.php` around lines 1110 -
1114, The step definition attribute on method iShouldSeeWithUnitPrice is
incorrect: change the attribute from #[When('/^I should see (product "[^"]+")
with unit price ("[^"]+")$/')] to #[Then(...)] so the assertion step is bound as
a Then step; update the attribute on the
iShouldSeeWithUnitPrice(ProductInterface $product, int $unitPrice): void method
in CheckoutContext to use #[Then] with the same regex pattern (no other code
changes needed).
| use Behat\Step\When; | ||
| use Behat\Step\Then; | ||
| use ApiPlatform\Metadata\IriConverterInterface; | ||
| use Behat\Behat\Context\Context; |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Import statements are not sorted alphabetically.
The new Behat\Step\* imports are placed before the ApiPlatform\* import, violating alphabetical ordering. Additionally, When is listed before Then.
Proposed fix
-use Behat\Step\When;
-use Behat\Step\Then;
use ApiPlatform\Metadata\IriConverterInterface;
use Behat\Behat\Context\Context;
+use Behat\Step\Then;
+use Behat\Step\When;
use Doctrine\Persistence\ObjectManager;As per coding guidelines: "Sort PHP use imports alphabetically and group by type (classes, functions, constants)".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use Behat\Step\When; | |
| use Behat\Step\Then; | |
| use ApiPlatform\Metadata\IriConverterInterface; | |
| use Behat\Behat\Context\Context; | |
| use ApiPlatform\Metadata\IriConverterInterface; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Step\Then; | |
| use Behat\Step\When; |
🤖 Prompt for AI Agents
In `@src/Sylius/Behat/Context/Api/Shop/HomepageContext.php` around lines 16 - 19,
Reorder the PHP use statements so imports are alphabetized and grouped by type:
move ApiPlatform\Metadata\IriConverterInterface before Behat\Step\Then and
Behat\Step\When, and ensure Then comes before When; keep
Behat\Behat\Context\Context in the correct group as well. Adjust the import
block containing Context, IriConverterInterface, Then, and When to follow
alphabetical order (Context, IriConverterInterface, Then, When) so the use list
in HomepageContext.php complies with the project's import-sorting rules.
|
Please rebase the PR, should be green now |
293872d to
6ec7d0a
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Sylius/Behat/Context/Api/Shop/ProductVariantContext.php (1)
72-79:⚠️ Potential issue | 🔴 CriticalBehavioral change:
iFilterVariantsByOptionnow immediately executes the filter request.This method previously only configured the filter via
addFilter(). Now it also calls$this->client->filter()and stores the result in shared storage. This is a functional change beyond the annotation-to-attribute migration scope of this PR.A scenario in
features/shop/product/show/options/viewing_diagonal_variant_options.feature(lines 37-38) chains multiple filter steps before an assertion:And I filter them by "Blue" option value And I filter them by "Small" option value Then I should not see any variantsThis scenario expects both filters to be accumulated and applied together. With the new behavior, each call executes
filter()independently, overwriting the shared storage result and breaking the intended multi-filter behavior. This must be reverted to the previous pattern of only callingaddFilter(), allowing another step to trigger the actual filter request.
🤖 Fix all issues with AI agents
In `@src/Sylius/Behat/Context/Api/Shop/LoginContext.php`:
- Around line 166-171: The method iLogOut() in class LoginContext is missing a
return type declaration; update the method signature for public function
iLogOut() to include the void return type (i.e. public function iLogOut(): void)
to match other methods in the class and satisfy the coding guideline requiring
return type declarations; ensure any callers/tests remain compatible and run
unit/Behat tests after the change.
In `@src/Sylius/Behat/Context/Api/Shop/ProductContext.php`:
- Around line 375-376: The step definition attribute on iShouldSeeOnlyProducts
is incorrectly marked as #[When] but it is an assertion and should be #[Then];
update the attribute on the iShouldSeeOnlyProducts method to use #[Then('/^I
should see only (\d+) product(s)$/')] so the step follows the Given-When-Then
convention and is recognized as a verification step by Behat.
🧹 Nitpick comments (13)
src/Sylius/Behat/Context/Api/Shop/CurrencyContext.php (1)
16-18: Imports are not sorted alphabetically.
Behat\Behat\Context\Contextshould come beforeBehat\Step\*. As per coding guidelines: "Sort PHPuseimports alphabetically and group by type."Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;src/Sylius/Behat/Context/Api/Shop/ExchangeRateContext.php (1)
16-17: Imports are not sorted alphabetically.
Behat\Step\Thenshould come beforeBehat\Step\When.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)."src/Sylius/Behat/Context/Api/Shop/ShipmentContext.php (1)
16-17: Imports are not sorted alphabetically.
Behat\Step\Thenshould come beforeBehat\Step\When.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Behat/Context/Api/Shop/Checkout/CheckoutOrderDetailsContext.php (1)
16-17: Import order:Thenshould come beforeWhenalphabetically.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)."src/Sylius/Behat/Context/Api/Shop/LocaleContext.php (1)
16-18: Imports are not sorted alphabetically.
Behat\Behat\Context\Contextshould come before theBehat\Step\*imports. As per coding guidelines: "Sort PHPuseimports alphabetically and group by type."Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;src/Sylius/Behat/Context/Api/Shop/Checkout/CheckoutCompleteContext.php (1)
16-19: Imports are not sorted alphabetically.The newly added
Behat\Step\GivenandBehat\Step\Thenwere inserted aboveBehat\Behat\Context\Context, breaking alphabetical order.Suggested fix
-use Behat\Step\Given; -use Behat\Step\Then; use Behat\Behat\Context\Context; +use Behat\Step\Given; +use Behat\Step\Then; use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Behat/Context/Api/Shop/CustomerContext.php (1)
16-17: Import order:Thenshould precedeWhenalphabetically.-use Behat\Step\When; -use Behat\Step\Then; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php (1)
16-17: Import order for newusestatements.The new
Behat\Step\WhenandBehat\Step\Thenimports are placed before theApiPlatformnamespace andThencomes afterWhen. Alphabetically,ApiPlatform<Behat, andThen<When. Consider reordering:-use Behat\Step\When; -use Behat\Step\Then; use ApiPlatform\Metadata\IriConverterInterface; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines, "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Behat/Context/Api/Shop/LoginContext.php (1)
16-18: Imports are not sorted alphabetically.
Behat\Step\*imports should be orderedGiven,Then,Whenand placed after theApiPlatform\Metadata\IriConverterInterfaceimport to maintain overall alphabetical order.Suggested fix
-use Behat\Step\Given; -use Behat\Step\When; -use Behat\Step\Then; use ApiPlatform\Metadata\IriConverterInterface; +use Behat\Step\Given; +use Behat\Step\Then; +use Behat\Step\When; use Behat\Behat\Context\Context;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Behat/Context/Api/Shop/ProductContext.php (1)
16-17: Import order:Behat\Step\ThenandBehat\Step\Whenare not sorted alphabetically between themselves.
Thenshould appear beforeWhenalphabetically.Proposed fix
-use Behat\Step\When; -use Behat\Step\Then; +use Behat\Step\Then; +use Behat\Step\When;src/Sylius/Behat/Context/Api/Shop/ProductVariantContext.php (1)
16-18: Import order:Behat\Step\*imports should followApiPlatform\*alphabetically.Per the coding guideline to sort
useimports alphabetically,ApiPlatform\Metadata\IriConverterInterfaceshould precede theBehat\Step\*imports. Also,Thenshould come beforeWhen.Suggested reorder
-use Behat\Step\When; -use Behat\Step\Then; use ApiPlatform\Metadata\IriConverterInterface; use Behat\Behat\Context\Context; +use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)"src/Sylius/Behat/Context/Api/Shop/AddressContext.php (2)
16-18: Imports are not sorted alphabetically.As per coding guidelines,
useimports should be sorted alphabetically.Thenshould come beforeWhen.Proposed fix
use Behat\Step\Given; -use Behat\Step\When; use Behat\Step\Then; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type".
307-311:$fullNameparameter is unused (PHPMD warning).This is an intentionally empty method (API context no-op for a UI step), which is a common pattern in this codebase. Consider adding a
/**@phpmd-suppressUnusedFormalParameter */or similar suppression to silence the static analysis warning explicitly.
| #[When('I log out')] | ||
| #[When('the customer logged out')] | ||
| public function iLogOut() | ||
| { | ||
| $this->apiSecurityClient->logOut(); | ||
| } |
There was a problem hiding this comment.
Missing return type declaration on iLogOut().
This method lacks the : void return type, unlike every other method in the class.
Suggested fix
- public function iLogOut()
+ public function iLogOut(): voidAs per coding guidelines: "Add type declarations for all properties, arguments, and return values in PHP code".
🤖 Prompt for AI Agents
In `@src/Sylius/Behat/Context/Api/Shop/LoginContext.php` around lines 166 - 171,
The method iLogOut() in class LoginContext is missing a return type declaration;
update the method signature for public function iLogOut() to include the void
return type (i.e. public function iLogOut(): void) to match other methods in the
class and satisfy the coding guideline requiring return type declarations;
ensure any callers/tests remain compatible and run unit/Behat tests after the
change.
| #[When('/^I should see only (\d+) product(s)$/')] | ||
| public function iShouldSeeOnlyProducts(int $count): void |
There was a problem hiding this comment.
#[When] should be #[Then] — this is an assertion step.
"I should see only N products" is a verification/assertion, which follows the Then convention in Given-When-Then. This should use #[Then] instead of #[When].
Proposed fix
- #[When('/^I should see only (\d+) product(s)$/')]
+ #[Then('/^I should see only (\d+) product(s)$/')]Based on learnings: "Follow Given-When-Then pattern strictly in Behat scenarios."
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| #[When('/^I should see only (\d+) product(s)$/')] | |
| public function iShouldSeeOnlyProducts(int $count): void | |
| #[Then('/^I should see only (\d+) product(s)$/')] | |
| public function iShouldSeeOnlyProducts(int $count): void |
🤖 Prompt for AI Agents
In `@src/Sylius/Behat/Context/Api/Shop/ProductContext.php` around lines 375 - 376,
The step definition attribute on iShouldSeeOnlyProducts is incorrectly marked as
#[When] but it is an assertion and should be #[Then]; update the attribute on
the iShouldSeeOnlyProducts method to use #[Then('/^I should see only (\d+)
product(s)$/')] so the step follows the Given-When-Then convention and is
recognized as a verification step by Behat.
|
@Rafikooo Done, CI is green. |
Summary by CodeRabbit
Refactor
Tests
Bug Fix