Repository navigation
Conversation
|
Hello @boo-code! This is your first pull request on ps_apiresources repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
8438490 to
9f0cccb
Compare
|
Updated in 9f0cccb so this no longer has to be merged in lockstep with the core side. The single-item expectations now adapt to the core they run against, instead of pinning private function expectedPosition(int $position): array
{
return method_exists(EditableAttributeGroup::class, 'getPosition') ? ['position' => $position] : [];
}
Why it matters: as it stood, this PR and PrestaShop/PrestaShop#41844 could not go green at the same time - #41844 fails One blocker I cannot clear myself: the workflow runs on this PR sit in |
|
Recording why this shows no CI, since it is not a state of the branch. All three workflow runs on Relevant because PrestaShop/PrestaShop#41844 keeps a red |
| */ | ||
| private function expectedPosition(int $position): array | ||
| { | ||
| return method_exists(EditableAttributeGroup::class, 'getPosition') ? ['position' => $position] : []; |
There was a problem hiding this comment.
Could you gate these expectations on the core version with self::isVersionAtLeast(), like the other core-dependent assertions (CountryEndpointTest, CustomerEndpointTest)? The method_exists() probe follows the class shape rather than the API contract and asserts nothing new on any current core, and pinning this branch in PrestaShop/PrestaShop#41844 already lets the core CI go green before either side merges.
The GET/POST/PATCH AttributeGroup responses now include the group position (PrestaShop/PrestaShop#39729, fixed core-side in PrestaShop/PrestaShop#41844). Update the endpoint test expectations accordingly.
9f0cccb to
786779b
Compare
|
Done: gated on |
positionfield now returned by the responses.composer create-test-dbthen runAttributeGroupEndpointTest.Context
PrestaShop/PrestaShop#39729: the Admin API
POST /attributes/groupresponse was missing thepositionkey. The core fix PrestaShop/PrestaShop#41844 addspositiontoEditableAttributeGroup, so the GET / POST / PATCH AttributeGroup responses now correctly includeposition.This updates
AttributeGroupEndpointTestto expect that key in the create, get and partial-update assertions (a newly created group takes the next position —position = itemsCount).Verification
Run end-to-end against an install carrying the core fix:
AttributeGroupEndpointTestis 15/15 green. Without the core fix it goes red on the newpositionexpectation (proving the two changes belong together).The expectation is gated on
self::isVersionAtLeast('9.3.0'), the milestone of PrestaShop/PrestaShop#41844. The develop leg already reports 9.3.0, so it runs the assertions and stays red until PrestaShop/PrestaShop#41844 merges; the other legs skip them.