22
33namespace Laravel \Octane \Tests ;
44
5- use ArrayObject ;
65use Illuminate \Support \Carbon ;
76use Illuminate \Support \Str ;
87use Laravel \Octane \Cache \OctaneStore ;
@@ -11,9 +10,9 @@ class OctaneStoreTest extends TestCase
1110{
1211 public function test_can_retrieve_items_from_store ()
1312 {
14- $ table = new ArrayObject ;
13+ $ table = $ this -> createSwooleTable () ;
1514
16- $ table[ 'foo ' ] = ['value ' => serialize ('bar ' ), 'expiration ' => time () + 100 ];
15+ $ table-> set ( 'foo ' , ['value ' => serialize ('bar ' ), 'expiration ' => time () + 100 ]) ;
1716
1817 $ store = new OctaneStore ($ table );
1918
@@ -22,7 +21,7 @@ public function test_can_retrieve_items_from_store()
2221
2322 public function test_missing_items_return_null ()
2423 {
25- $ table = new ArrayObject ;
24+ $ table = $ this -> createSwooleTable () ;
2625
2726 $ store = new OctaneStore ($ table );
2827
@@ -31,18 +30,18 @@ public function test_missing_items_return_null()
3130
3231 public function test_expired_items_return_null ()
3332 {
34- $ table = new ArrayObject ;
33+ $ table = $ this -> createSwooleTable () ;
3534
3635 $ store = new OctaneStore ($ table );
3736
38- $ table[ 'foo ' ] = ['value ' => serialize ('bar ' ), 'expiration ' => time () - 100 ];
37+ $ table-> set ( 'foo ' , ['value ' => serialize ('bar ' ), 'expiration ' => time () - 100 ]) ;
3938
4039 $ this ->assertNull ($ store ->get ('foo ' ));
4140 }
4241
4342 public function test_get_method_can_resolve_pending_interval ()
4443 {
45- $ table = new ArrayObject ;
44+ $ table = $ this -> createSwooleTable () ;
4645
4746 $ store = new OctaneStore ($ table );
4847
@@ -53,10 +52,10 @@ public function test_get_method_can_resolve_pending_interval()
5352
5453 public function test_many_method_can_return_many_values ()
5554 {
56- $ table = new ArrayObject ;
55+ $ table = $ this -> createSwooleTable () ;
5756
58- $ table[ 'foo ' ] = ['value ' => serialize ('bar ' ), 'expiration ' => time () + 100 ];
59- $ table[ 'bar ' ] = ['value ' => serialize ('baz ' ), 'expiration ' => time () + 100 ];
57+ $ table-> set ( 'foo ' , ['value ' => serialize ('bar ' ), 'expiration ' => time () + 100 ]) ;
58+ $ table-> set ( 'bar ' , ['value ' => serialize ('baz ' ), 'expiration ' => time () + 100 ]) ;
6059
6160 $ store = new OctaneStore ($ table );
6261
@@ -65,7 +64,7 @@ public function test_many_method_can_return_many_values()
6564
6665 public function test_put_stores_value_in_table ()
6766 {
68- $ table = new ArrayObject ;
67+ $ table = $ this -> createSwooleTable () ;
6968
7069 $ store = new OctaneStore ($ table );
7170
@@ -76,7 +75,7 @@ public function test_put_stores_value_in_table()
7675
7776 public function test_put_many_stores_value_in_table ()
7877 {
79- $ table = new ArrayObject ;
78+ $ table = $ this -> createSwooleTable () ;
8079
8180 $ store = new OctaneStore ($ table );
8281
@@ -88,7 +87,7 @@ public function test_put_many_stores_value_in_table()
8887
8988 public function test_increment_and_decrement_operations ()
9089 {
91- $ table = new ArrayObject ;
90+ $ table = $ this -> createSwooleTable () ;
9291
9392 $ store = new OctaneStore ($ table );
9493
@@ -104,7 +103,7 @@ public function test_increment_and_decrement_operations()
104103
105104 public function test_forever_stores_value_in_table ()
106105 {
107- $ table = new ArrayObject ;
106+ $ table = $ this -> createSwooleTable () ;
108107
109108 $ store = new OctaneStore ($ table );
110109
@@ -115,7 +114,7 @@ public function test_forever_stores_value_in_table()
115114
116115 public function test_intervals_can_be_refreshed ()
117116 {
118- $ table = new ArrayObject ;
117+ $ table = $ this -> createSwooleTable () ;
119118
120119 $ store = new OctaneStore ($ table );
121120
@@ -135,7 +134,7 @@ public function test_intervals_can_be_refreshed()
135134
136135 public function test_can_forget_cache_items ()
137136 {
138- $ table = new ArrayObject ;
137+ $ table = $ this -> createSwooleTable () ;
139138
140139 $ store = new OctaneStore ($ table );
141140
@@ -152,7 +151,7 @@ public function test_can_forget_cache_items()
152151
153152 public function test_intervals_are_not_flushed ()
154153 {
155- $ table = new ArrayObject ;
154+ $ table = $ this -> createSwooleTable () ;
156155
157156 $ store = new OctaneStore ($ table );
158157
0 commit comments