Skip to content

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

Draft
alongosz wants to merge 9 commits into5.0from
ibx-8138/tests-dry-refactoring
Draft

[Tests] Refactored various unit tests to make them DRY#408
alongosz wants to merge 9 commits into5.0from
ibx-8138/tests-dry-refactoring

Conversation

@alongosz
Copy link
Copy Markdown
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.

@sonarqubecloud
Copy link
Copy Markdown

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
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

@adamwojs
Copy link
Copy Markdown
Member

@alongosz rebase is needed here

@ibexa-yuna ibexa-yuna deleted the branch 5.0 April 29, 2026 08:16
@ibexa-yuna ibexa-yuna closed this Apr 29, 2026
@mnocon mnocon reopened this Apr 29, 2026
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@mnocon mnocon changed the base branch from main to 5.0 April 29, 2026 09:40
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.

6 participants