@@ -120,7 +120,7 @@ public function testHumanizeMonthsForward(): void
120
120
$ current = Time::parse ('March 1, 2017 ' , 'America/Chicago ' );
121
121
$ diff = $ current ->difference ('May 1, 2017 ' , 'America/Chicago ' );
122
122
123
- $ this ->assertSame ('in 1 month ' , $ diff ->humanize ('en ' ));
123
+ $ this ->assertSame ('in 2 months ' , $ diff ->humanize ('en ' ));
124
124
}
125
125
126
126
public function testHumanizeDaysSingle (): void
@@ -211,12 +211,20 @@ public function testHumanizeWeeksPlural(): void
211
211
$ this ->assertSame ('2 weeks ago ' , $ diff ->humanize ('en ' ));
212
212
}
213
213
214
- public function testHumanizeWeeksForward (): void
214
+ public function testHumanizeWeeksForwardDST (): void
215
215
{
216
216
$ current = Time::parse ('March 10, 2017 ' , 'America/Chicago ' );
217
217
$ diff = $ current ->difference ('March 18, 2017 ' , 'America/Chicago ' );
218
218
219
- $ this ->assertSame ('in 1 week ' , $ diff ->humanize ('en ' ));
219
+ $ this ->assertSame ('in 2 weeks ' , $ diff ->humanize ('en ' ));
220
+ }
221
+
222
+ public function testHumanizeWeeksForwardUTC (): void
223
+ {
224
+ $ current = Time::parse ('2017-03-10 ' );
225
+ $ diff = $ current ->difference ('2017-03-18 ' );
226
+
227
+ $ this ->assertSame ('in 2 weeks ' , $ diff ->humanize ('en ' ));
220
228
}
221
229
222
230
public function testHumanizeNoDifference (): void
@@ -238,14 +246,14 @@ public function testGetterUTC(): void
238
246
$ this ->assertNull ($ diff ->nonsense );
239
247
}
240
248
241
- public function testGetterChicagoTime (): void
249
+ public function testGetterDST (): void
242
250
{
243
251
$ current = Time::parse ('March 10, 2017 ' , 'America/Chicago ' );
244
252
$ diff = $ current ->difference ('March 18, 2017 ' , 'America/Chicago ' );
245
253
246
254
// Daylight Saving Time had begun since Sun, 12 Mar, 02:00.
247
- $ this ->assertSame (7 , $ diff ->getDays ());
248
- $ this ->assertSame (7 , $ diff ->days );
255
+ $ this ->assertSame (8 , $ diff ->getDays ());
256
+ $ this ->assertSame (8 , $ diff ->days );
249
257
250
258
// The raw value does not take Daylight Saving Time into account.
251
259
$ this ->assertSame (-8 , (int ) round ($ diff ->getDays (true )));
0 commit comments