Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Test that an exception is thrown when a membership is saved using invalid roles #499

Merged
merged 3 commits into from
Jun 13, 2019

Conversation

pfrenssen
Copy link
Contributor

This is preparatory work for #487. In that issue it is proposed to refactor OgMembership::getRolesIds() but we only have basic test coverage for the relation of roles and memberships. Our current test coverage (OgMembershipRoleReferenceTest) hits all of the related methods at least once, but we are lacking systematic coverage with data providers that check all possible code paths. I would like to enhance our code coverage before attempting to refactor the current code.

This is a first PR in this effort, checking all the code paths in which saving a membership with invalid roles will result in an exception.

@pfrenssen
Copy link
Contributor Author

This is failing because of #502.

@pfrenssen
Copy link
Contributor Author

It is green now on Travis. Codeclimate is still experimental.

Copy link
Collaborator

@MPParsley MPParsley left a comment

Choose a reason for hiding this comment

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

The test looks good, thanks!

I flagged all default feedback from CodeClimate so the tick is now green.

Note: As long as we don't enable branch protection for CodeClimate you can still merge a PR even with feedback from CC.

@pfrenssen pfrenssen merged commit 539c0d5 into 8.x-1.x Jun 13, 2019
@pfrenssen pfrenssen deleted the test-membership-with-invalid-roles branch June 13, 2019 14:29
@pfrenssen pfrenssen added this to the 8.x-1.0-alpha4 milestone Jul 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants