-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currencies API + first approach to API Behat tests #11128
Conversation
Zales0123
commented
Feb 18, 2020
Q | A |
---|---|
Branch? | api |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Related tickets | |
License | MIT |
36223e7
to
b1ab6b1
Compare
src/Sylius/Behat/Context/Api/Admin/ManagingCurrenciesContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingCurrenciesContext.php
Outdated
Show resolved
Hide resolved
$this->client->request('GET', '/new-api/'.$resource, [], [], ['HTTP_ACCEPT' => 'application/ld+json']); | ||
} | ||
|
||
public function buildCreateRequest(string $resource): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next iteration, maybe client and request could be separate objects (to not make service stateful), and request could be some VO, or created fluent interfaces?
src/Sylius/Behat/Context/Api/Admin/ManagingCurrenciesContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingCurrenciesContext.php
Outdated
Show resolved
Hide resolved
*/ | ||
public function iShouldBeNotifiedThatSomethingHappened(): void | ||
{ | ||
Assert::true($this->client->isCreationSuccessful(), 'Currency could not be created'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert::true($this->client->isCreationSuccessful(), 'Currency could not be created'); | |
Assert::true($this->client->isCreationSuccessful(), 'Resource could not be created'); |
Thank you, Mateusz! 🎉 |