1818
1919class TtlTest extends TestCase
2020{
21- public function testString ()
21+ public function testString (): void
2222 {
2323 $ this ->assertSame (600 , Ttl::fromMinutes ('10 ' ));
2424 $ this ->assertSame (10 , Ttl::fromSeconds ('10 ' ));
2525 }
2626
27- public function testInteger ()
27+ public function testInteger (): void
2828 {
2929 $ this ->assertSame (600 , Ttl::fromMinutes (10 ));
3030 $ this ->assertSame (10 , Ttl::fromSeconds (10 ));
3131 }
3232
33- public function testCarbon ()
33+ public function testCarbon (): void
3434 {
3535 $ ttl = Carbon::now ()->addDay ();
3636
37- $ expected = Carbon::now ()->diffInRealSeconds ($ ttl );
37+ $ expected = ( int ) Carbon::now ()->diffInSeconds ($ ttl );
3838
3939 $ this ->assertSame ($ expected , Ttl::fromMinutes ($ ttl ));
4040 $ this ->assertSame ($ expected , Ttl::fromSeconds ($ ttl ));
4141 }
4242
43- public function testDateTimeInterface ()
43+ public function testDateTimeInterface (): void
4444 {
4545 $ ttl = new DateTime ('tomorrow ' );
4646
47- $ expected = Carbon::now ()->diffInRealSeconds ($ ttl );
47+ $ expected = ( int ) Carbon::now ()->diffInSeconds ($ ttl );
4848
4949 $ this ->assertSame ($ expected , Ttl::fromMinutes ($ ttl ));
5050 $ this ->assertSame ($ expected , Ttl::fromSeconds ($ ttl ));
5151 }
5252
53- public function testClosure ()
53+ public function testClosure (): void
5454 {
5555 $ ttl = function () {
5656 return $ this ->ttl ;
@@ -60,7 +60,7 @@ public function testClosure()
6060 $ this ->assertSame (60 , Ttl::fromSeconds ($ ttl ));
6161 }
6262
63- public function testObjectAsString ()
63+ public function testObjectAsString (): void
6464 {
6565 $ this ->assertSame (18000 , Ttl::fromMinutes (CustomObject::class));
6666 $ this ->assertSame (300 , Ttl::fromSeconds (CustomObject::class));
@@ -78,7 +78,7 @@ public function testObjectAsString()
7878 $ this ->assertSame (3600 , Ttl::fromSeconds ('unknown ' ));
7979 }
8080
81- public function testObjectAsObject ()
81+ public function testObjectAsObject (): void
8282 {
8383 $ this ->assertSame (18000 , Ttl::fromMinutes (new CustomObject ()));
8484 $ this ->assertSame (300 , Ttl::fromSeconds (new CustomObject ()));
@@ -95,11 +95,11 @@ public function testObjectAsObject()
9595
9696 public function testInstances (): void
9797 {
98- $ this ->assertSame (3600 , Ttl::fromMinutes ((new AsCarbon ('foo ' ))->cacheTtl ()));
99- $ this ->assertSame (7200 , Ttl::fromSeconds ((new AsCarbon ('bar ' ))->cacheTtl ()));
98+ $ this ->assertSame (3599 , Ttl::fromMinutes ((new AsCarbon ('foo ' ))->cacheTtl ()));
99+ $ this ->assertSame (7199 , Ttl::fromSeconds ((new AsCarbon ('bar ' ))->cacheTtl ()));
100100
101- $ this ->assertSame (3600 , Ttl::fromMinutes ((new AsDateTime ('foo ' ))->cacheTtl ()));
102- $ this ->assertSame (7200 , Ttl::fromSeconds ((new AsDateTime ('bar ' ))->cacheTtl ()));
101+ $ this ->assertSame (3599 , Ttl::fromMinutes ((new AsDateTime ('foo ' ))->cacheTtl ()));
102+ $ this ->assertSame (7199 , Ttl::fromSeconds ((new AsDateTime ('bar ' ))->cacheTtl ()));
103103
104104 $ this ->assertSame (600 , Ttl::fromMinutes ((new AsInteger ('foo ' ))->cacheTtl ()));
105105 $ this ->assertSame (20 , Ttl::fromSeconds ((new AsInteger ('bar ' ))->cacheTtl ()));
0 commit comments