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

[Tests] Refactored various unit tests to make them DRY #408

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

alongosz
Copy link
Member

@alongosz alongosz commented Jul 17, 2024

🎫 Issue Related to IBX-8138

TODO

  • Seems there's more code duplication detected.

Related PRs:

Description:

This PR addresses a several of the many code redundancy issues found by SonarCloud while working on #385.

Refactored few unit test clases, including Base Repository service mock tests to avoid code redundancy.

Changelog:

  • [Tests] Fixed code duplication in Content & Location handler tests
  • [Tests] Refactored redundant code in RejectExplicitFrontControllerRequestsListenerTest
  • [Tests] Improved quality of Base Repository service mock tests
  • [Tests] Refactored ContentTest to drop redundancy
  • [Tests] Refactored PermissionsCriterionHandlerTest to rely on base permission resolver
  • [Tests] Aligned RelationProcessorTest with Base changes
  • [Tests] Aligned RoleTest with Base changes
  • [Tests] Aligned PermissionTest with Base changes
  • [PHPStan] Aligned baseline with the changes

For QA

No QA required, unit test changes only.

Copy link

sonarcloud bot commented Jul 17, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
16.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@alongosz alongosz force-pushed the ibx-8138/tests-dry-refactoring branch from 927ca85 to 3daa761 Compare August 28, 2024 12:35
Copy link

sonarcloud bot commented Aug 28, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
16.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

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.

3 participants