Skip to content

test: add unit test coverage for simple events, cache and parser#12576

Merged
kesselb merged 1 commit intomainfrom
test/events-cache-parser-coverage
Mar 17, 2026
Merged

test: add unit test coverage for simple events, cache and parser#12576
kesselb merged 1 commit intomainfrom
test/events-cache-parser-coverage

Conversation

@ChristophWurst
Copy link
Copy Markdown
Member

Generated tests for simple, boring code

AI-assisted: OpenCode + Claude Haiku 4.5

This comment was marked as outdated.

@ChristophWurst ChristophWurst requested a review from Copilot March 17, 2026 08:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds PHPUnit unit test coverage for several small “value object” style classes in the Mail app (events + cache helpers) and for the HTML parser utility.

Changes:

  • Add unit tests for OCA\Mail\Html\Parser::parseToDomDocument() across a few representative HTML inputs.
  • Add unit tests asserting constructor/getter behavior for multiple OCA\Mail\Events\* event classes.
  • Add unit tests for cache helpers (CachedMailbox, HordeSyncToken, HordeSyncTokenParser).

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/Html/ParserTest.php Covers Parser::parseToDomDocument() with minimal/malformed/complex HTML inputs.
tests/Unit/Events/SynchronizationEventTest.php Verifies SynchronizationEvent constructor + getters.
tests/Unit/Events/SaveDraftEventTest.php Verifies SaveDraftEvent constructor + getters (with/without draft).
tests/Unit/Events/OutboxMessageCreatedEventTest.php Verifies OutboxMessageCreatedEvent constructor + getters.
tests/Unit/Events/NewMessagesSynchronizedTest.php Verifies NewMessagesSynchronized constructor + getters (incl. empty messages).
tests/Unit/Events/NewMessageReceivedEventTest.php Verifies NewMessageReceivedEvent URI getter.
tests/Unit/Events/MessageSentEventTest.php Verifies MessageSentEvent constructor + getters.
tests/Unit/Events/MessageFlaggedEventTest.php Verifies MessageFlaggedEvent constructor + getters for set/unset cases.
tests/Unit/Events/MessageDeletedEventTest.php Verifies MessageDeletedEvent constructor + getters.
tests/Unit/Events/MailboxesSynchronizedEventTest.php Verifies MailboxesSynchronizedEvent account getter.
tests/Unit/Events/DraftSavedEventTest.php Verifies DraftSavedEvent optional parameter combinations.
tests/Unit/Events/DraftMessageCreatedEventTest.php Verifies DraftMessageCreatedEvent constructor + getters.
tests/Unit/Events/BeforeMessageDeletedEventTest.php Verifies BeforeMessageDeletedEvent constructor + getters.
tests/Unit/Events/BeforeImapClientCreatedTest.php Verifies BeforeImapClientCreated account getter.
tests/Unit/Cache/HordeSyncTokenTest.php Verifies HordeSyncToken getters for full/null/partial inputs.
tests/Unit/Cache/HordeSyncTokenParserTest.php Verifies HordeSyncTokenParser::parseSyncToken() for multiple token shapes.
tests/Unit/Cache/CachedMailboxTest.php Verifies CachedMailbox defaults and setter/getter behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

This comment was marked as resolved.

AI-assisted: OpenCode + Claude Haiku 4.5
Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
@ChristophWurst ChristophWurst force-pushed the test/events-cache-parser-coverage branch from c634652 to fc4cc9f Compare March 17, 2026 09:19
@kesselb kesselb merged commit 5505b08 into main Mar 17, 2026
42 checks passed
@kesselb kesselb deleted the test/events-cache-parser-coverage branch March 17, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants