44
55use LukeWaite \LaravelAwsCacheAdapter \LaravelCacheAdapter ;
66use Mockery as m ;
7+ use PHPUnit \Framework \Attributes \Test ;
78use PHPUnit \Framework \TestCase ;
89
910class LaravelCacheAdapterTest extends TestCase
@@ -13,12 +14,12 @@ class LaravelCacheAdapterTest extends TestCase
1314
1415 protected $ repository ;
1516
16- public function tearDown (): void
17+ protected function tearDown (): void
1718 {
1819 m::close ();
1920 }
2021
21- public function setUp (): void
22+ protected function setUp (): void
2223 {
2324 $ this ->manager = m::mock ('Illuminate\Cache\CacheManager ' );
2425 $ this ->manager ->shouldReceive ('store ' )
@@ -27,51 +28,62 @@ public function setUp(): void
2728 ->andReturn ($ this ->repository = m::mock ('StdClass ' ));
2829 }
2930
30- public function testGetWithPrefix ()
31+ #[Test]
32+ public function test_get_with_prefix ()
3133 {
3234 $ this ->repository ->shouldReceive ('get ' )->with ('aws_credentials_testkey ' )->once ()->andReturn ('testValue ' );
3335
3436 $ adapter = new LaravelCacheAdapter ($ this ->manager , 'file ' , 'test ' );
3537 $ this ->assertEquals ('testValue ' , $ adapter ->get ('key ' ));
3638 }
3739
38- public function testRemoveWithoutPrefix ()
40+ #[Test]
41+ public function test_remove_without_prefix ()
3942 {
4043 $ this ->repository ->shouldReceive ('forget ' )->with ('aws_credentials_key_to_remove ' )->once ();
4144
4245 $ adapter = new LaravelCacheAdapter ($ this ->manager , 'file ' , '' );
4346 $ adapter ->remove ('key_to_remove ' );
47+ $ this ->assertTrue (true ); // Add assertion to avoid risky test
4448 }
4549
46- public function testSetLessThan60SecondsRoundsUp ()
50+ #[Test]
51+ public function test_set_less_than60_seconds_rounds_up ()
4752 {
4853 $ this ->repository ->shouldReceive ('put ' )->with ('aws_credentials_key ' , 'value ' , 1 )->once ();
4954
5055 $ adapter = new LaravelCacheAdapter ($ this ->manager , 'file ' , '' );
5156 $ adapter ->set ('key ' , 'value ' , 59 );
57+ $ this ->assertTrue (true ); // Add assertion to avoid risky test
5258 }
5359
54- public function testSetGreaterThan60SecondsRoundsDown ()
60+ #[Test]
61+ public function test_set_greater_than60_seconds_rounds_down ()
5562 {
5663 $ this ->repository ->shouldReceive ('put ' )->with ('aws_credentials_key ' , 'value ' , 1 )->once ();
5764
5865 $ adapter = new LaravelCacheAdapter ($ this ->manager , 'file ' , '' );
5966 $ adapter ->set ('key ' , 'value ' , 61 );
67+ $ this ->assertTrue (true ); // Add assertion to avoid risky test
6068 }
6169
62- public function testSetGreaterThan120SecondsRoundsDown ()
70+ #[Test]
71+ public function test_set_greater_than120_seconds_rounds_down ()
6372 {
6473 $ this ->repository ->shouldReceive ('put ' )->with ('aws_credentials_key ' , 'value ' , 2 )->once ();
6574
6675 $ adapter = new LaravelCacheAdapter ($ this ->manager , 'file ' , '' );
6776 $ adapter ->set ('key ' , 'value ' , 121 );
77+ $ this ->assertTrue (true ); // Add assertion to avoid risky test
6878 }
6979
70- public function testSet0Retains0 ()
80+ #[Test]
81+ public function test_set0_retains0 ()
7182 {
7283 $ this ->repository ->shouldReceive ('put ' )->with ('aws_credentials_key ' , 'value ' , 0 )->once ();
7384
7485 $ adapter = new LaravelCacheAdapter ($ this ->manager , 'file ' , '' );
7586 $ adapter ->set ('key ' , 'value ' , 0 );
87+ $ this ->assertTrue (true ); // Add assertion to avoid risky test
7688 }
7789}
0 commit comments