Skip to content

[TASK] Migrate controller tests to functional tests (deleteAction)#1734

Merged
oliverklee merged 1 commit intomainfrom
1569-migrate-existing-unit-tests-to-functional-split-delete-action
Jul 7, 2025
Merged

[TASK] Migrate controller tests to functional tests (deleteAction)#1734
oliverklee merged 1 commit intomainfrom
1569-migrate-existing-unit-tests-to-functional-split-delete-action

Conversation

@DanielSiepmann
Copy link
Copy Markdown
Contributor

It is considered best practice to cover controllers via functional instead of unit tests.
We therefore migrate the existing unit tests to functional tests.

The migration is split into multiple batches for smaller changes. This one covers tests related to deleteAction().

Relates: #1569

@DanielSiepmann DanielSiepmann added this to the 4.0.0: Breaking changes milestone Jul 7, 2025
@DanielSiepmann DanielSiepmann self-assigned this Jul 7, 2025
@DanielSiepmann DanielSiepmann force-pushed the 1569-migrate-existing-unit-tests-to-functional-split-delete-action branch from 89ff4fe to f2bda2a Compare July 7, 2025 11:20
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 7, 2025

Pull Request Test Coverage Report for Build 16116811570

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 16115288185: 0.0%
Covered Lines: 107
Relevant Lines: 107

💛 - Coveralls

@DanielSiepmann DanielSiepmann force-pushed the 1569-migrate-existing-unit-tests-to-functional-split-delete-action branch from f2bda2a to 54ce26e Compare July 7, 2025 11:24
@DanielSiepmann DanielSiepmann requested a review from a team July 7, 2025 11:26
@DanielSiepmann DanielSiepmann moved this from In Progress to In review in Best Practices code sprint Jul 7, 2025
Comment thread Tests/Functional/Controller/FrontEndEditorControllerTest.php Outdated
@DanielSiepmann DanielSiepmann force-pushed the 1569-migrate-existing-unit-tests-to-functional-split-delete-action branch from 54ce26e to 6f0af6e Compare July 7, 2025 11:34
@DanielSiepmann DanielSiepmann requested a review from oliverklee July 7, 2025 11:35
private const PAGE_UID = 1;
private const TEA_UID_OWNED_BY_LOGGED_IN_USER = '1';
private const TEA_UID_OWNED_BY_FOREIGN_USER = '2';
private const TEA_UID_WITHOUT_OWNER = '3';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've thought about this some more … The updated naming still has the issue that the "owned" gramatically refers to the UID, not the tea. I've now come up with this:

    private const UID_OF_TEA_OWNED_BY_LOGGED_IN_USER = '1';
    private const UID_OF_TEA_OWNED_BY_FOREIGN_USER = '2';
    private const UID_OF_TEA_WITHOUT_OWNER = '3';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adjusted. I also adjusted PAGE_UID to consistency.

It is considered best practice to cover controllers via functional
instead of unit tests.
We therefore migrate the existing unit tests to functional tests.

The migration is split into multiple batches for smaller changes.
This one covers tests related to `deleteAction()`.

Relates: #1569
@DanielSiepmann DanielSiepmann force-pushed the 1569-migrate-existing-unit-tests-to-functional-split-delete-action branch from 6f0af6e to 5458427 Compare July 7, 2025 12:22
@DanielSiepmann DanielSiepmann requested a review from oliverklee July 7, 2025 12:22
@oliverklee oliverklee merged commit f327d27 into main Jul 7, 2025
37 checks passed
@oliverklee oliverklee deleted the 1569-migrate-existing-unit-tests-to-functional-split-delete-action branch July 7, 2025 12:46
@github-project-automation github-project-automation Bot moved this from In review to Done in Best Practices code sprint Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants