Skip to content
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

Merged
merged 10 commits into from
Feb 21, 2020

Conversation

Zales0123
Copy link
Member

Q A
Branch? api
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
License MIT

@Zales0123 Zales0123 added Feature New feature proposals. DX Issues and PRs aimed at improving Developer eXperience. Behat Issues and PRs aimed at improving Behat usage. labels Feb 18, 2020
@Zales0123 Zales0123 requested a review from a team as a code owner February 18, 2020 15:24
$this->client->request('GET', '/new-api/'.$resource, [], [], ['HTTP_ACCEPT' => 'application/ld+json']);
}

public function buildCreateRequest(string $resource): void
Copy link
Member

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/NotificationContext.php Outdated Show resolved Hide resolved
*/
public function iShouldBeNotifiedThatSomethingHappened(): void
{
Assert::true($this->client->isCreationSuccessful(), 'Currency could not be created');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Assert::true($this->client->isCreationSuccessful(), 'Currency could not be created');
Assert::true($this->client->isCreationSuccessful(), 'Resource could not be created');

@lchrusciel lchrusciel merged commit 5ab2b70 into Sylius:api Feb 21, 2020
@lchrusciel
Copy link
Member

Thank you, Mateusz! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Behat Issues and PRs aimed at improving Behat usage. DX Issues and PRs aimed at improving Developer eXperience. Feature New feature proposals.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants