| @@ 1228-1236 (lines=9) @@ | ||
| 1225 | ); |
|
| 1226 | } |
|
| 1227 | ||
| 1228 | public function testDiffForHumansOtherAndFutureSecond() |
|
| 1229 | { |
|
| 1230 | $scope = $this; |
|
| 1231 | $this->wrapWithTestNow( |
|
| 1232 | function () use ($scope) { |
|
| 1233 | $scope->assertSame('1 second after', Date::now()->diffForHumans(Date::now()->subSecond())); |
|
| 1234 | } |
|
| 1235 | ); |
|
| 1236 | } |
|
| 1237 | ||
| 1238 | public function testDiffForHumansOtherAndFutureSeconds() |
|
| 1239 | { |
|
| @@ 19-30 (lines=12) @@ | ||
| 16 | ||
| 17 | class PtTest extends AbstractTestCase |
|
| 18 | { |
|
| 19 | public function testDiffForHumansLocalizedInPortuguese() |
|
| 20 | { |
|
| 21 | Date::setLocale('pt'); |
|
| 22 | ||
| 23 | $scope = $this; |
|
| 24 | $this->wrapWithTestNow( |
|
| 25 | function () use ($scope) { |
|
| 26 | $d = Date::now()->subSecond(); |
|
| 27 | $scope->assertSame('1 segundo atrás', $d->diffForHumans()); |
|
| 28 | } |
|
| 29 | ); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function testDiffForHumansLocalizedInPortugueseBrazil() |
|
| 33 | { |
|
| @@ 32-43 (lines=12) @@ | ||
| 29 | ); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function testDiffForHumansLocalizedInPortugueseBrazil() |
|
| 33 | { |
|
| 34 | Date::setLocale('pt-BR'); |
|
| 35 | ||
| 36 | $scope = $this; |
|
| 37 | $this->wrapWithTestNow( |
|
| 38 | function () use ($scope) { |
|
| 39 | $d = Date::now()->subSecond(); |
|
| 40 | $scope->assertSame('há 1 segundo', $d->diffForHumans()); |
|
| 41 | } |
|
| 42 | ); |
|
| 43 | } |
|
| 44 | ||
| 45 | public function testDiffForHumansLocalizedInPortugueseBrazilBC() |
|
| 46 | { |
|
| @@ 45-56 (lines=12) @@ | ||
| 42 | ); |
|
| 43 | } |
|
| 44 | ||
| 45 | public function testDiffForHumansLocalizedInPortugueseBrazilBC() |
|
| 46 | { |
|
| 47 | Date::setLocale('pt_BR'); |
|
| 48 | ||
| 49 | $scope = $this; |
|
| 50 | $this->wrapWithTestNow( |
|
| 51 | function () use ($scope) { |
|
| 52 | $d = Date::now()->subSecond(); |
|
| 53 | $scope->assertSame('há 1 segundo', $d->diffForHumans()); |
|
| 54 | } |
|
| 55 | ); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||