| @@ 1429-1438 (lines=10) @@ | ||
| 1426 | ); |
|
| 1427 | } |
|
| 1428 | ||
| 1429 | public function testDiffForHumansAbsoluteSeconds() |
|
| 1430 | { |
|
| 1431 | $scope = $this; |
|
| 1432 | $this->wrapWithTestNow( |
|
| 1433 | function () use ($scope) { |
|
| 1434 | $scope->assertSame('59 seconds', Date::now()->diffForHumans(Date::now()->subSeconds(59), true)); |
|
| 1435 | $scope->assertSame('59 seconds', Date::now()->diffForHumans(Date::now()->addSeconds(59), true)); |
|
| 1436 | } |
|
| 1437 | ); |
|
| 1438 | } |
|
| 1439 | ||
| 1440 | public function testDiffForHumansAbsoluteMinutes() |
|
| 1441 | { |
|
| @@ 1440-1449 (lines=10) @@ | ||
| 1437 | ); |
|
| 1438 | } |
|
| 1439 | ||
| 1440 | public function testDiffForHumansAbsoluteMinutes() |
|
| 1441 | { |
|
| 1442 | $scope = $this; |
|
| 1443 | $this->wrapWithTestNow( |
|
| 1444 | function () use ($scope) { |
|
| 1445 | $scope->assertSame('30 minutes', Date::now()->diffForHumans(Date::now()->subMinutes(30), true)); |
|
| 1446 | $scope->assertSame('30 minutes', Date::now()->diffForHumans(Date::now()->addMinutes(30), true)); |
|
| 1447 | } |
|
| 1448 | ); |
|
| 1449 | } |
|
| 1450 | ||
| 1451 | public function testDiffForHumansAbsoluteHours() |
|
| 1452 | { |
|
| @@ 1451-1460 (lines=10) @@ | ||
| 1448 | ); |
|
| 1449 | } |
|
| 1450 | ||
| 1451 | public function testDiffForHumansAbsoluteHours() |
|
| 1452 | { |
|
| 1453 | $scope = $this; |
|
| 1454 | $this->wrapWithTestNow( |
|
| 1455 | function () use ($scope) { |
|
| 1456 | $scope->assertSame('3 hours', Date::now()->diffForHumans(Date::now()->subHours(3), true)); |
|
| 1457 | $scope->assertSame('3 hours', Date::now()->diffForHumans(Date::now()->addHours(3), true)); |
|
| 1458 | } |
|
| 1459 | ); |
|
| 1460 | } |
|
| 1461 | ||
| 1462 | public function testDiffForHumansAbsoluteDays() |
|
| 1463 | { |
|
| @@ 1462-1471 (lines=10) @@ | ||
| 1459 | ); |
|
| 1460 | } |
|
| 1461 | ||
| 1462 | public function testDiffForHumansAbsoluteDays() |
|
| 1463 | { |
|
| 1464 | $scope = $this; |
|
| 1465 | $this->wrapWithTestNow( |
|
| 1466 | function () use ($scope) { |
|
| 1467 | $scope->assertSame('2 days', Date::now()->diffForHumans(Date::now()->subDays(2), true)); |
|
| 1468 | $scope->assertSame('2 days', Date::now()->diffForHumans(Date::now()->addDays(2), true)); |
|
| 1469 | } |
|
| 1470 | ); |
|
| 1471 | } |
|
| 1472 | ||
| 1473 | public function testDiffForHumansAbsoluteWeeks() |
|
| 1474 | { |
|
| @@ 1473-1482 (lines=10) @@ | ||
| 1470 | ); |
|
| 1471 | } |
|
| 1472 | ||
| 1473 | public function testDiffForHumansAbsoluteWeeks() |
|
| 1474 | { |
|
| 1475 | $scope = $this; |
|
| 1476 | $this->wrapWithTestNow( |
|
| 1477 | function () use ($scope) { |
|
| 1478 | $scope->assertSame('2 weeks', Date::now()->diffForHumans(Date::now()->subWeeks(2), true)); |
|
| 1479 | $scope->assertSame('2 weeks', Date::now()->diffForHumans(Date::now()->addWeeks(2), true)); |
|
| 1480 | } |
|
| 1481 | ); |
|
| 1482 | } |
|
| 1483 | ||
| 1484 | public function testDiffForHumansAbsoluteMonths() |
|
| 1485 | { |
|
| @@ 1484-1493 (lines=10) @@ | ||
| 1481 | ); |
|
| 1482 | } |
|
| 1483 | ||
| 1484 | public function testDiffForHumansAbsoluteMonths() |
|
| 1485 | { |
|
| 1486 | $scope = $this; |
|
| 1487 | $this->wrapWithTestNow( |
|
| 1488 | function () use ($scope) { |
|
| 1489 | $scope->assertSame('2 months', Date::now()->diffForHumans(Date::now()->subMonths(2), true)); |
|
| 1490 | $scope->assertSame('2 months', Date::now()->diffForHumans(Date::now()->addMonths(2), true)); |
|
| 1491 | } |
|
| 1492 | ); |
|
| 1493 | } |
|
| 1494 | ||
| 1495 | public function testDiffForHumansAbsoluteYears() |
|
| 1496 | { |
|
| @@ 1495-1504 (lines=10) @@ | ||
| 1492 | ); |
|
| 1493 | } |
|
| 1494 | ||
| 1495 | public function testDiffForHumansAbsoluteYears() |
|
| 1496 | { |
|
| 1497 | $scope = $this; |
|
| 1498 | $this->wrapWithTestNow( |
|
| 1499 | function () use ($scope) { |
|
| 1500 | $scope->assertSame('1 year', Date::now()->diffForHumans(Date::now()->subYears(1), true)); |
|
| 1501 | $scope->assertSame('1 year', Date::now()->diffForHumans(Date::now()->addYears(1), true)); |
|
| 1502 | } |
|
| 1503 | ); |
|
| 1504 | } |
|
| 1505 | ||
| 1506 | public function testDiffForHumansWithShorterMonthShouldStillBeAMonth() |
|
| 1507 | { |
|