File tree Expand file tree Collapse file tree 25 files changed +405
-0
lines changed
Expand file tree Collapse file tree 25 files changed +405
-0
lines changed Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Arr ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \DragonCodeArrayable ;
910
@@ -36,6 +37,20 @@ public function testPut()
3637 $ this ->assertNull ($ this ->cache ()->get ());
3738 }
3839
40+ #[DataProvider('booleanData ' )]
41+ public function testFlexible (bool $ isTrue )
42+ {
43+ $ item = new DragonCodeArrayable ();
44+
45+ $ interval = $ isTrue
46+ ? $ this ->positiveTtlInterval
47+ : $ this ->negativeTtlInterval ;
48+
49+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
50+
51+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
52+ }
53+
3954 public function testRemember ()
4055 {
4156 $ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Arr ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \IlluminateArrayable ;
910
@@ -36,6 +37,20 @@ public function testPut()
3637 $ this ->assertNull ($ this ->cache ()->get ());
3738 }
3839
40+ #[DataProvider('booleanData ' )]
41+ public function testFlexible (bool $ isTrue )
42+ {
43+ $ item = new IlluminateArrayable ();
44+
45+ $ interval = $ isTrue
46+ ? $ this ->positiveTtlInterval
47+ : $ this ->negativeTtlInterval ;
48+
49+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
50+
51+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
52+ }
53+
3954 public function testRemember ()
4055 {
4156 $ item = new IlluminateArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Arr ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \MixedArrayable ;
910
@@ -40,6 +41,20 @@ public function testPut()
4041 $ this ->assertNull ($ this ->cache ()->get ());
4142 }
4243
44+ #[DataProvider('booleanData ' )]
45+ public function testFlexible (bool $ isTrue )
46+ {
47+ $ item = new MixedArrayable ();
48+
49+ $ interval = $ isTrue
50+ ? $ this ->positiveTtlInterval
51+ : $ this ->negativeTtlInterval ;
52+
53+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
54+
55+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
56+ }
57+
4358 public function testRemember ()
4459 {
4560 $ item = new MixedArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Files ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \DragonCodeArrayable ;
910
@@ -38,6 +39,20 @@ public function testPut()
3839 $ this ->assertNull ($ this ->cache ()->get ());
3940 }
4041
42+ #[DataProvider('booleanData ' )]
43+ public function testFlexible (bool $ isTrue )
44+ {
45+ $ item = new DragonCodeArrayable ();
46+
47+ $ interval = $ isTrue
48+ ? $ this ->positiveTtlInterval
49+ : $ this ->negativeTtlInterval ;
50+
51+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
52+
53+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
54+ }
55+
4156 public function testRemember ()
4257 {
4358 $ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Files ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \IlluminateArrayable ;
910
@@ -38,6 +39,20 @@ public function testPut()
3839 $ this ->assertNull ($ this ->cache ()->get ());
3940 }
4041
42+ #[DataProvider('booleanData ' )]
43+ public function testFlexible (bool $ isTrue )
44+ {
45+ $ item = new IlluminateArrayable ();
46+
47+ $ interval = $ isTrue
48+ ? $ this ->positiveTtlInterval
49+ : $ this ->negativeTtlInterval ;
50+
51+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
52+
53+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
54+ }
55+
4156 public function testRemember ()
4257 {
4358 $ item = new IlluminateArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Files ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \MixedArrayable ;
910
@@ -42,6 +43,20 @@ public function testPut()
4243 $ this ->assertNull ($ this ->cache ()->get ());
4344 }
4445
46+ #[DataProvider('booleanData ' )]
47+ public function testFlexible (bool $ isTrue )
48+ {
49+ $ item = new MixedArrayable ();
50+
51+ $ interval = $ isTrue
52+ ? $ this ->positiveTtlInterval
53+ : $ this ->negativeTtlInterval ;
54+
55+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
56+
57+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
58+ }
59+
4560 public function testRemember ()
4661 {
4762 $ item = new MixedArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Redis ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \DragonCodeArrayable ;
910
@@ -46,6 +47,24 @@ public function testPut()
4647 $ this ->assertNull ($ this ->cache (['cache ' ])->get ());
4748 }
4849
50+ #[DataProvider('booleanData ' )]
51+ public function testFlexible (bool $ isTrue )
52+ {
53+ $ item = new DragonCodeArrayable ();
54+
55+ $ interval = $ isTrue
56+ ? $ this ->positiveTtlInterval
57+ : $ this ->negativeTtlInterval ;
58+
59+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
60+
61+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
62+ $ this ->assertNull ($ this ->cache (['qwerty ' , 'cache ' ])->flexible ($ interval )->get ());
63+
64+ $ this ->assertNull ($ this ->cache (['qwerty ' ])->flexible ($ interval )->get ());
65+ $ this ->assertNull ($ this ->cache (['cache ' ])->flexible ($ interval )->get ());
66+ }
67+
4968 public function testRemember ()
5069 {
5170 $ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Redis ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \IlluminateArrayable ;
910
@@ -46,6 +47,24 @@ public function testPut()
4647 $ this ->assertNull ($ this ->cache (['cache ' ])->get ());
4748 }
4849
50+ #[DataProvider('booleanData ' )]
51+ public function testFlexible (bool $ isTrue )
52+ {
53+ $ item = new IlluminateArrayable ();
54+
55+ $ interval = $ isTrue
56+ ? $ this ->positiveTtlInterval
57+ : $ this ->negativeTtlInterval ;
58+
59+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
60+
61+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
62+ $ this ->assertNull ($ this ->cache (['qwerty ' , 'cache ' ])->flexible ($ interval )->get ());
63+
64+ $ this ->assertNull ($ this ->cache (['qwerty ' ])->flexible ($ interval )->get ());
65+ $ this ->assertNull ($ this ->cache (['cache ' ])->flexible ($ interval )->get ());
66+ }
67+
4968 public function testRemember ()
5069 {
5170 $ item = new IlluminateArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Many \Redis ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Many \MixedArrayable ;
910
@@ -50,6 +51,24 @@ public function testPut()
5051 $ this ->assertNull ($ this ->cache (['cache ' ])->get ());
5152 }
5253
54+ #[DataProvider('booleanData ' )]
55+ public function testFlexible (bool $ isTrue )
56+ {
57+ $ item = new MixedArrayable ();
58+
59+ $ interval = $ isTrue
60+ ? $ this ->positiveTtlInterval
61+ : $ this ->negativeTtlInterval ;
62+
63+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
64+
65+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
66+ $ this ->assertNull ($ this ->cache (['qwerty ' , 'cache ' ])->flexible ($ interval )->get ());
67+
68+ $ this ->assertNull ($ this ->cache (['qwerty ' ])->flexible ($ interval )->get ());
69+ $ this ->assertNull ($ this ->cache (['cache ' ])->flexible ($ interval )->get ());
70+ }
71+
5372 public function testRemember ()
5473 {
5574 $ item = new MixedArrayable ();
Original file line number Diff line number Diff line change 44
55namespace Tests \Cache \NotWhen \Arrayables \Simple \Arr ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Tests \Cache \NotWhen \Base ;
89use Tests \Fixtures \Simple \DragonCodeArrayable ;
910
@@ -32,6 +33,20 @@ public function testPut()
3233 $ this ->assertNull ($ this ->cache ()->get ());
3334 }
3435
36+ #[DataProvider('booleanData ' )]
37+ public function testFlexible (bool $ isTrue )
38+ {
39+ $ item = new DragonCodeArrayable ();
40+
41+ $ interval = $ isTrue
42+ ? $ this ->positiveTtlInterval
43+ : $ this ->negativeTtlInterval ;
44+
45+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
46+
47+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
48+ }
49+
3550 public function testRemember ()
3651 {
3752 $ item = new DragonCodeArrayable ();
You can’t perform that action at this time.
0 commit comments