55use ForFit \Mongodb \Cache \MongoTaggedCache ;
66use ForFit \Mongodb \Cache \Store ;
77use Illuminate \Support \Carbon ;
8+ use PHPUnit \Framework \Attributes \Test ;
89use Tests \Models \Cache ;
910
1011class StoreTest extends TestCase
1112{
12- protected $ store ;
13+ protected Store $ store ;
1314
1415 protected function setUp (): void
1516 {
@@ -21,8 +22,8 @@ protected function setUp(): void
2122 Carbon::setTestNow (now ());
2223 }
2324
24- /** @test */
25- public function it_stores_an_item_in_the_cache_for_given_time ()
25+ #[Test]
26+ public function it_stores_an_item_in_the_cache_for_given_time (): void
2627 {
2728 // Act
2829 $ sut = $ this ->store ->put ('test-key ' , 'test-value ' , 3 );
@@ -37,8 +38,8 @@ public function it_stores_an_item_in_the_cache_for_given_time()
3738 ]);
3839 }
3940
40- /** @test */
41- public function it_updates_an_item_in_the_cache_for_given_time ()
41+ #[Test]
42+ public function it_updates_an_item_in_the_cache_for_given_time (): void
4243 {
4344 Cache::create ([
4445 'key ' => 'test-key ' ,
@@ -58,8 +59,8 @@ public function it_updates_an_item_in_the_cache_for_given_time()
5859 ]);
5960 }
6061
61- /** @test */
62- public function it_retrieves_value_from_the_cache_by_given_key ()
62+ #[Test]
63+ public function it_retrieves_value_from_the_cache_by_given_key (): void
6364 {
6465 // Arrange
6566 Cache::create ([
@@ -75,8 +76,8 @@ public function it_retrieves_value_from_the_cache_by_given_key()
7576 $ this ->assertEquals ('test-value ' , $ sut );
7677 }
7778
78- /** @test */
79- public function it_returns_null_if_key_does_not_exist ()
79+ #[Test]
80+ public function it_returns_null_if_key_does_not_exist (): void
8081 {
8182 // Act
8283 $ sut = $ this ->store ->get ('test-key ' );
@@ -85,8 +86,8 @@ public function it_returns_null_if_key_does_not_exist()
8586 $ this ->assertNull ($ sut );
8687 }
8788
88- /** @test */
89- public function it_sets_the_tags_to_be_used ()
89+ #[Test]
90+ public function it_sets_the_tags_to_be_used (): void
9091 {
9192 // Act
9293 $ sut = $ this ->store ->tags (['tag1 ' , 'tag2 ' ]);
@@ -96,8 +97,8 @@ public function it_sets_the_tags_to_be_used()
9697 $ this ->assertPropertySame (['tag1 ' , 'tag2 ' ], 'tags ' , $ sut );
9798 }
9899
99- /** @test */
100- public function it_deletes_all_records_with_the_given_tag ()
100+ #[Test]
101+ public function it_deletes_all_records_with_the_given_tag (): void
101102 {
102103 // Arrange
103104 Cache::create ([
@@ -126,8 +127,8 @@ public function it_deletes_all_records_with_the_given_tag()
126127 ]);
127128 }
128129
129- /** @test */
130- public function it_retrieves_an_items_expiration_time_by_given_key ()
130+ #[Test]
131+ public function it_retrieves_an_items_expiration_time_by_given_key (): void
131132 {
132133 // Arrange
133134 Cache::create ([
0 commit comments