-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make FrozenClock mutable through setter #1
Make FrozenClock mutable through setter #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @frankkoornstra, just some small changes 😄
src/FrozenClock.php
Outdated
@@ -18,6 +18,11 @@ public function __construct(DateTimeImmutable $now) | |||
$this->now = $now; | |||
} | |||
|
|||
public function setTo(DateTimeImmutable $now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: void
please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
test/FrozenClockTest.php
Outdated
* @test | ||
* | ||
* @covers \Lcobucci\Clock\FrozenClock::setTo | ||
* @covers \Lcobucci\Clock\FrozenClock::now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\Lcobucci\Clock\FrozenClock::now
should be marked as @uses
instead of @covers
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to add @uses \Lcobucci\Clock\FrozenClock::__construct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Because the FrozenClock is often injected in other objects during testing, being able to change the current time on the FrozenClock without reinjecting it in the object under test is quite useful.
Because the FrozenClock is often injected in other objects during
testing, being able to change the current time on the FrozenClock
without reinjecting it in the object under test is quite useful.