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

Add Swagger DocumentationNormalizer test for array collection filters #2241

Merged
merged 1 commit into from
Oct 6, 2018
Merged

Add Swagger DocumentationNormalizer test for array collection filters #2241

merged 1 commit into from
Oct 6, 2018

Conversation

Pandoraaa
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #2199
License MIT
Doc PR

There's a merged PR #2114 but this part wasn't tested yet, so I added the test in the case of an array collection filters in the Swagger documentation.

];

foreach ($filters as $filterId => $filter) {
$filterLocatorProphecy->has($filterId)->willReturn(true)->shouldBeCalled();
$filterLocatorProphecy->get($filterId)->willReturn($filter)->shouldBeCalled();
}

$filterLocatorProphecy->has('f3')->willReturn(false)->shouldBeCalled();
$filterLocatorProphecy->has('f4')->willReturn(false)->shouldBeCalled();
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a fault of this PR, but ->shouldBeCalled() should only be used when we actually want to check that a method is called. If the intention is only to mock the return value of the method, ->willReturn(...) should suffice.

@alanpoulain alanpoulain merged commit 6d6b7ef into api-platform:2.3 Oct 6, 2018
@Pandoraaa Pandoraaa deleted the add-test-swagger-array-filter branch October 14, 2019 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants