File tree 25 files changed +405
-0
lines changed
25 files changed +405
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Arr ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \DragonCodeArrayable ;
9
10
@@ -36,6 +37,20 @@ public function testPut()
36
37
$ this ->assertNull ($ this ->cache ()->get ());
37
38
}
38
39
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
+
39
54
public function testRemember ()
40
55
{
41
56
$ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Arr ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \IlluminateArrayable ;
9
10
@@ -36,6 +37,20 @@ public function testPut()
36
37
$ this ->assertNull ($ this ->cache ()->get ());
37
38
}
38
39
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
+
39
54
public function testRemember ()
40
55
{
41
56
$ item = new IlluminateArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Arr ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \MixedArrayable ;
9
10
@@ -40,6 +41,20 @@ public function testPut()
40
41
$ this ->assertNull ($ this ->cache ()->get ());
41
42
}
42
43
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
+
43
58
public function testRemember ()
44
59
{
45
60
$ item = new MixedArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Files ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \DragonCodeArrayable ;
9
10
@@ -38,6 +39,20 @@ public function testPut()
38
39
$ this ->assertNull ($ this ->cache ()->get ());
39
40
}
40
41
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
+
41
56
public function testRemember ()
42
57
{
43
58
$ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Files ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \IlluminateArrayable ;
9
10
@@ -38,6 +39,20 @@ public function testPut()
38
39
$ this ->assertNull ($ this ->cache ()->get ());
39
40
}
40
41
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
+
41
56
public function testRemember ()
42
57
{
43
58
$ item = new IlluminateArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Files ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \MixedArrayable ;
9
10
@@ -42,6 +43,20 @@ public function testPut()
42
43
$ this ->assertNull ($ this ->cache ()->get ());
43
44
}
44
45
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
+
45
60
public function testRemember ()
46
61
{
47
62
$ item = new MixedArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Redis ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \DragonCodeArrayable ;
9
10
@@ -46,6 +47,24 @@ public function testPut()
46
47
$ this ->assertNull ($ this ->cache (['cache ' ])->get ());
47
48
}
48
49
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
+
49
68
public function testRemember ()
50
69
{
51
70
$ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Redis ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \IlluminateArrayable ;
9
10
@@ -46,6 +47,24 @@ public function testPut()
46
47
$ this ->assertNull ($ this ->cache (['cache ' ])->get ());
47
48
}
48
49
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
+
49
68
public function testRemember ()
50
69
{
51
70
$ item = new IlluminateArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Many \Redis ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Many \MixedArrayable ;
9
10
@@ -50,6 +51,24 @@ public function testPut()
50
51
$ this ->assertNull ($ this ->cache (['cache ' ])->get ());
51
52
}
52
53
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
+
53
72
public function testRemember ()
54
73
{
55
74
$ item = new MixedArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Simple \Arr ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Simple \DragonCodeArrayable ;
9
10
@@ -32,6 +33,20 @@ public function testPut()
32
33
$ this ->assertNull ($ this ->cache ()->get ());
33
34
}
34
35
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
+
35
50
public function testRemember ()
36
51
{
37
52
$ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Simple \Arr ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
9
+ use Tests \Fixtures \Simple \DragonCodeArrayable ;
8
10
use Tests \Fixtures \Simple \IlluminateArrayable ;
9
11
10
12
class IlluminateTest extends Base
@@ -32,6 +34,20 @@ public function testPut()
32
34
$ this ->assertNull ($ this ->cache ()->get ());
33
35
}
34
36
37
+ #[DataProvider('booleanData ' )]
38
+ public function testFlexible (bool $ isTrue )
39
+ {
40
+ $ item = new IlluminateArrayable ();
41
+
42
+ $ interval = $ isTrue
43
+ ? $ this ->positiveTtlInterval
44
+ : $ this ->negativeTtlInterval ;
45
+
46
+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
47
+
48
+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
49
+ }
50
+
35
51
public function testRemember ()
36
52
{
37
53
$ item = new IlluminateArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Simple \Files ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Simple \DragonCodeArrayable ;
9
10
@@ -34,6 +35,20 @@ public function testPut()
34
35
$ this ->assertNull ($ this ->cache ()->get ());
35
36
}
36
37
38
+ #[DataProvider('booleanData ' )]
39
+ public function testFlexible (bool $ isTrue )
40
+ {
41
+ $ item = new DragonCodeArrayable ();
42
+
43
+ $ interval = $ isTrue
44
+ ? $ this ->positiveTtlInterval
45
+ : $ this ->negativeTtlInterval ;
46
+
47
+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
48
+
49
+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
50
+ }
51
+
37
52
public function testRemember ()
38
53
{
39
54
$ item = new DragonCodeArrayable ();
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tests \Cache \NotWhen \Arrayables \Simple \Files ;
6
6
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
7
8
use Tests \Cache \NotWhen \Base ;
8
9
use Tests \Fixtures \Simple \IlluminateArrayable ;
9
10
@@ -34,6 +35,20 @@ public function testPut()
34
35
$ this ->assertNull ($ this ->cache ()->get ());
35
36
}
36
37
38
+ #[DataProvider('booleanData ' )]
39
+ public function testFlexible (bool $ isTrue )
40
+ {
41
+ $ item = new IlluminateArrayable ();
42
+
43
+ $ interval = $ isTrue
44
+ ? $ this ->positiveTtlInterval
45
+ : $ this ->negativeTtlInterval ;
46
+
47
+ $ this ->assertSame ($ item , $ this ->cache ()->flexible ($ interval )->remember ($ item ));
48
+
49
+ $ this ->assertNull ($ this ->cache ()->flexible ($ interval )->get ());
50
+ }
51
+
37
52
public function testRemember ()
38
53
{
39
54
$ item = new IlluminateArrayable ();
You can’t perform that action at this time.
0 commit comments