Skip to content

fix: make possible to test with dates#5535

Merged
vitormattos merged 7 commits intomainfrom
fix/make-possible-to-test-with-dates
Oct 9, 2025
Merged

fix: make possible to test with dates#5535
vitormattos merged 7 commits intomainfrom
fix/make-possible-to-test-with-dates

Conversation

@vitormattos
Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos added this to the Next Major (33) milestone Oct 9, 2025
@vitormattos vitormattos requested a review from Copilot October 9, 2025 02:19
@vitormattos vitormattos self-assigned this Oct 9, 2025
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Oct 9, 2025
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

This PR fixes date handling in tests by implementing proper mocking of time dependencies and using fixed dates for consistent test execution. The change enables deterministic testing by eliminating reliance on the current system time.

  • Changed ITimeFactory from concrete dependency to mocked object in tests
  • Replaced dynamic date creation with fixed UTC timestamps
  • Modified getStartTime() method to use injected time factory instead of creating new DateTime instances directly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/php/Unit/Service/ReminderServiceTest.php Mock ITimeFactory and use fixed timestamps for deterministic testing
lib/Service/ReminderService.php Refactor getStartTime() to use injected time factory for better testability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread lib/Service/ReminderService.php
Comment thread lib/Service/ReminderService.php Outdated
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable31

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
G will return 0 to 23
H will return 00 to 23

G will return without left zero when is a number with only a digit.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos requested a review from Copilot October 9, 2025 12:36
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread lib/Service/ReminderService.php Outdated
Comment thread lib/Service/ReminderService.php
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos merged commit 054f8e5 into main Oct 9, 2025
57 checks passed
@vitormattos vitormattos deleted the fix/make-possible-to-test-with-dates branch October 9, 2025 13:28
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Oct 9, 2025
@EdnaldoNeimeg EdnaldoNeimeg removed this from the Next Major (33) milestone Oct 11, 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