Add functional tests for schema validation and voter assertions - #72
Merged
Merged
Conversation
Cover seeDoctrineSchemaIsValid(), seeUserIsGranted() and dontSeeUserIsGranted() from Codeception/module-symfony#246. They pass once composer.lock points at a module-symfony revision containing that pull request. The application gains a UserVoter that grants USER_EDIT only on the account of the authenticated user, so the new assertions run against a real voter instead of a plain role check. It implements VoterInterface rather than extending Voter, whose abstract voteOnAttribute() signature is not the same across the Symfony versions covered by the branches of this repository.
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.
Adds functional coverage for the assertions introduced in Codeception/module-symfony#246:
seeDoctrineSchemaIsValid()seeUserIsGranted()/dontSeeUserIsGranted()The application gains a
UserVoterthat grantsUSER_EDITonly on the account of theauthenticated user, so the security assertions run against a real voter with a subject
instead of a plain role check. It implements
VoterInterfacerather than extendingVoter, whose abstractvoteOnAttribute()signature is not the same across the Symfonyversions covered by the branches of this repository.
Verification
These tests need a
codeception/module-symfonyrevision containing #246, which is not inits
mainyet, so CI on this pull request fails until that one is merged andcomposer.lockhere is refreshed.They were verified on a fork branch identical to this one except for a
composer.lockpointing at the #246 head (
d83f581):The three new tests in that run:
composer.lockon5.4currently pins adev-mainrevision that predates #247, somockService,seeMessengerQueueCount,seeNumQueriesIsLessThanandassertSessionHasFlashMessagealready fail on this branch today. A singlecomposer update codeception/module-symfonyonce #246 is merged clears both that and thispull request.