Skip to content

Commit 78ab885

Browse files
committed
Don't set testNow on all the things.
1 parent 07457ed commit 78ab885

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

tests/TestCase/I18n/TimeTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public function setUp()
3333
{
3434
parent::setUp();
3535
$this->now = Time::getTestNow();
36-
$this->frozenNow = FrozenTime::getTestNow();
3736
$this->locale = Time::getDefaultLocale();
3837
Time::setDefaultLocale('en_US');
3938
FrozenTime::setDefaultLocale('en_US');
@@ -52,7 +51,6 @@ public function tearDown()
5251
Time::resetToStringFormat();
5352
Time::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssxxx");
5453

55-
FrozenTime::setTestNow($this->frozenNow);
5654
FrozenTime::setDefaultLocale($this->locale);
5755
FrozenTime::resetToStringFormat();
5856
FrozenTime::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssxxx");
@@ -682,7 +680,7 @@ public function testDiffForHumans($class)
682680
*/
683681
public function testDiffForHumansAbsolute($class)
684682
{
685-
$class::setTestNow(new $class('2015-12-12 10:10:10'));
683+
Time::setTestNow(new $class('2015-12-12 10:10:10'));
686684
$time = new $class('2014-04-20 10:10:10');
687685
$this->assertEquals('1 year', $time->diffForHumans(null, ['absolute' => true]));
688686

@@ -701,7 +699,7 @@ public function testDiffForHumansAbsolute($class)
701699
*/
702700
public function testDiffForHumansNow($class)
703701
{
704-
$class::setTestNow(new $class('2015-12-12 10:10:10'));
702+
Time::setTestNow(new $class('2015-12-12 10:10:10'));
705703
$time = new $class('2014-04-20 10:10:10');
706704
$this->assertEquals('1 year ago', $time->diffForHumans());
707705

tests/bootstrap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@
126126
]);
127127

128128
Chronos::setTestNow(Chronos::now());
129-
MutableDateTime::setTestNow(MutableDateTime::now());
130-
Date::setTestNow(Date::now());
131-
MutableDate::setTestNow(MutableDate::now());
132129

133130
ini_set('intl.default_locale', 'en_US');
134131
ini_set('session.gc_divisor', '1');

0 commit comments

Comments
 (0)