Get, Update, Post and delete catalog promotions#12994
Merged
GSadee merged 5 commits intoAug 25, 2021
Merged
Conversation
dbf1c91 to
80231af
Compare
80231af to
8186723
Compare
GSadee
reviewed
Aug 24, 2021
Member
GSadee
left a comment
There was a problem hiding this comment.
IMO, in this PR you should add also behat scenarios for updating and deleting catalog promotion
GSadee
reviewed
Aug 24, 2021
524246b to
089e60a
Compare
b8062d5 to
5128035
Compare
5128035 to
9044d8f
Compare
Contributor
Author
|
Behat tests for this feature will be added in next PR 🎉 |
AdamKasp
approved these changes
Aug 24, 2021
lchrusciel
reviewed
Aug 24, 2021
Comment on lines
+52
to
+54
| <attribute name="normalization_context"> | ||
| <attribute name="groups">admin:catalog_promotion:update</attribute> | ||
| </attribute> |
Contributor
There was a problem hiding this comment.
Suggested change
| <attribute name="normalization_context"> | |
| <attribute name="groups">admin:catalog_promotion:update</attribute> | |
| </attribute> | |
| <attribute name="normalization_context"> | |
| <attribute name="groups">admin:catalog_promotion:read</attribute> | |
| </attribute> |
GSadee
approved these changes
Aug 25, 2021
| <collectionOperation name="admin_post"> | ||
| <attribute name="method">POST</attribute> | ||
| <attribute name="normalization_context"> | ||
| <attribute name="groups">admin:catalog_promotion:create</attribute> |
Member
There was a problem hiding this comment.
Suggested change
| <attribute name="groups">admin:catalog_promotion:create</attribute> | |
| <attribute name="groups">admin:catalog_promotion:read</attribute> |
|
|
||
| $response = $this->client->getResponse(); | ||
|
|
||
| $this->assertResponse($response, 'admin/catalog_promotion/get_catalog_promotions_admin_response', Response::HTTP_OK); |
Member
There was a problem hiding this comment.
Suggested change
| $this->assertResponse($response, 'admin/catalog_promotion/get_catalog_promotions_admin_response', Response::HTTP_OK); | |
| $this->assertResponse($response, 'admin/catalog_promotion/get_catalog_promotions_response', Response::HTTP_OK); |
| $response = $this->client->getResponse(); | ||
|
|
||
| $this->assertResponse($response, 'admin/get_catalog_promotions_response', Response::HTTP_OK); | ||
| $this->assertResponse($response, 'admin/catalog_promotion/get_catalog_promotion_admin_response', Response::HTTP_OK); |
Member
There was a problem hiding this comment.
Suggested change
| $this->assertResponse($response, 'admin/catalog_promotion/get_catalog_promotion_admin_response', Response::HTTP_OK); | |
| $this->assertResponse($response, 'admin/catalog_promotion/get_catalog_promotion_response', Response::HTTP_OK); |
|
|
||
| $response = $this->client->getResponse(); | ||
|
|
||
| $this->assertResponse($response, 'admin/catalog_promotion/post_catalog_promotion_admin_response', Response::HTTP_CREATED); |
Member
There was a problem hiding this comment.
Suggested change
| $this->assertResponse($response, 'admin/catalog_promotion/post_catalog_promotion_admin_response', Response::HTTP_CREATED); | |
| $this->assertResponse($response, 'admin/catalog_promotion/post_catalog_promotion_response', Response::HTTP_CREATED); |
|
|
||
| $response = $this->client->getResponse(); | ||
|
|
||
| $this->assertResponse($response, 'admin/catalog_promotion/put_catalog_promotion_admin_response', Response::HTTP_OK); |
Member
There was a problem hiding this comment.
Suggested change
| $this->assertResponse($response, 'admin/catalog_promotion/put_catalog_promotion_admin_response', Response::HTTP_OK); | |
| $this->assertResponse($response, 'admin/catalog_promotion/put_catalog_promotion_response', Response::HTTP_OK); |
| $token = $this->logInAdminUser('[email protected]'); | ||
| $authorizationHeader = self::$container->getParameter('sylius.api.authorization_header'); | ||
| $header['HTTP_' . $authorizationHeader] = 'Bearer ' . $token; | ||
| return array_merge($header, self::CONTENT_TYPE_HEADER); |
Member
There was a problem hiding this comment.
Suggested change
| return array_merge($header, self::CONTENT_TYPE_HEADER); | |
| return array_merge($header, self::CONTENT_TYPE_HEADER); |
| "@id": "\/api\/v2\/admin\/catalog-promotions\/mugs_discount", | ||
| "@type": "CatalogPromotion", | ||
| "id": @integer@, | ||
| "id": "@integer@", |
Member
There was a problem hiding this comment.
Why did you change that? IMO here and in other responses there should be:
Suggested change
| "id": "@integer@", | |
| "id": @integer@, |
Member
|
Thank you, @arti0090! 🥇 |
GSadee
added a commit
that referenced
this pull request
Aug 25, 2021
This PR was merged into the 1.11-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | License | MIT minor fixes of #12994 Commits ------- 54328e9 Fixes to endpoints and contract tests of CP
GSadee
added a commit
that referenced
this pull request
Aug 26, 2021
… (arti0090) This PR was merged into the 1.11-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | yes (behat for feature) | BC breaks? | no | Deprecations? | no | License | MIT Promised behats for #12994 Commits ------- 3e37138 Add delete behat with factory c690e3b Delete covered in behat be54912 Edit covered in behats 4e67186 Revert behat of delete 2912c4f Changing services and tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extends #12986