Use more mocking instead of allowing to override final classes #13
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.
If a package vendor specifies a class as final, they really do not expect the class to ever be overridden. Also, adding this package to require-dev allows us to do so in a dev environment, even accidentally outside of tests, and that code will only fail when running in production.
Instead of trying to enable mocking SearchFilter, we can just instantiate it and mock a little more in another place. The test testNormalizeDoesntReplaceWhenStrategyIsNotExact was flawed, because the search strategy is always forced to be "exact" when filtering by an association. For this reason, I removed that test, because it does not make sense to test a primitive field filter in the context of RelatedCollectionLinkNormalizer. This normalizer is only concerned with associations, not with primitive fields.