@@ -22,33 +22,6 @@ class DisabledCachedBuilderTest extends UnitTestCase
2222{
2323 use RefreshDatabase;
2424
25- public function setUp ()
26- {
27- parent ::setUp ();
28-
29- cache ()->flush ();
30- $ publishers = factory (Publisher::class, 10 )->create ();
31- factory (Author::class, 10 )->create ()
32- ->each (function ($ author ) use ($ publishers ) {
33- factory (Book::class, random_int (2 , 10 ))->make ()
34- ->each (function ($ book ) use ($ author , $ publishers ) {
35- $ book ->author ()->associate ($ author );
36- $ book ->publisher ()->associate ($ publishers [rand (0 , 9 )]);
37- $ book ->save ();
38- });
39- factory (Profile::class)->make ([
40- 'author_id ' => $ author ->id ,
41- ]);
42- });
43-
44- $ bookIds = (new Book )->all ()->pluck ('id ' );
45- factory (Store::class, 10 )->create ()
46- ->each (function ($ store ) use ($ bookIds ) {
47- $ store ->books ()->sync (rand ($ bookIds ->min (), $ bookIds ->max ()));
48- });
49- cache ()->flush ();
50- }
51-
5225 public function testAvgModelResultsIsNotCached ()
5326 {
5427 $ authorId = (new Author )
@@ -62,7 +35,7 @@ public function testAvgModelResultsIsNotCached()
6235 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
6336 ];
6437
65- $ cachedResult = cache ()
38+ $ cachedResult = $ this -> cache ()
6639 ->tags ($ tags )
6740 ->get ($ key );
6841 $ liveResult = (new UncachedAuthor )
@@ -111,7 +84,8 @@ public function testChunkModelResultsIsNotCached()
11184
11285 for ($ index = 0 ; $ index < $ cachedChunks ['authors ' ]->count (); $ index ++) {
11386 $ key = $ cachedChunks ['keys ' ][$ index ];
114- $ cachedResults = cache ()->tags ($ tags )
87+ $ cachedResults = $ this ->cache ()
88+ ->tags ($ tags )
11589 ->get ($ key );
11690
11791 $ this ->assertNull ($ cachedResults );
@@ -132,7 +106,7 @@ public function testCountModelResultsIsNotCached()
132106 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
133107 ];
134108
135- $ cachedResults = cache ()
109+ $ cachedResults = $ this -> cache ()
136110 ->tags ($ tags )
137111 ->get ($ key );
138112 $ liveResults = (new UncachedAuthor )
@@ -156,7 +130,7 @@ public function testCursorModelResultsIsNotCached()
156130 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
157131 ];
158132
159- $ cachedResults = cache ()
133+ $ cachedResults = $ this -> cache ()
160134 ->tags ($ tags )
161135 ->get ($ key );
162136 $ liveResults = collect (
@@ -180,7 +154,7 @@ public function testFindModelResultsIsNotCached()
180154 'genealabslaravelmodelcachingtestsfixturesauthor ' ,
181155 ];
182156
183- $ cachedResult = cache ()
157+ $ cachedResult = $ this -> cache ()
184158 ->tags ($ tags )
185159 ->get ($ key );
186160 $ liveResult = (new UncachedAuthor )
@@ -203,7 +177,7 @@ public function testGetModelResultsIsNotCached()
203177 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
204178 ];
205179
206- $ cachedResults = cache ()
180+ $ cachedResults = $ this -> cache ()
207181 ->tags ($ tags )
208182 ->get ($ key );
209183 $ liveResults = (new UncachedAuthor )
@@ -227,7 +201,7 @@ public function testMaxModelResultsIsNotCached()
227201 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
228202 ];
229203
230- $ cachedResult = cache ()
204+ $ cachedResult = $ this -> cache ()
231205 ->tags ($ tags )
232206 ->get ($ key );
233207 $ liveResult = (new UncachedAuthor )
@@ -251,7 +225,7 @@ public function testMinModelResultsIsNotCached()
251225 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
252226 ];
253227
254- $ cachedResult = cache ()
228+ $ cachedResult = $ this -> cache ()
255229 ->tags ($ tags )
256230 ->get ($ key );
257231 $ liveResult = (new UncachedAuthor )
@@ -275,7 +249,7 @@ public function testPluckModelResultsIsNotCached()
275249 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
276250 ];
277251
278- $ cachedResults = cache ()
252+ $ cachedResults = $ this -> cache ()
279253 ->tags ($ tags )
280254 ->get ($ key );
281255 $ liveResults = (new UncachedAuthor )
@@ -299,7 +273,7 @@ public function testSumModelResultsIsNotCached()
299273 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
300274 ];
301275
302- $ cachedResult = cache ()
276+ $ cachedResult = $ this -> cache ()
303277 ->tags ($ tags )
304278 ->get ($ key );
305279 $ liveResult = (new UncachedAuthor )
@@ -323,7 +297,7 @@ public function testValueModelResultsIsNotCached()
323297 'genealabslaravelmodelcachingtestsfixturesprofile ' ,
324298 ];
325299
326- $ cachedResult = cache ()
300+ $ cachedResult = $ this -> cache ()
327301 ->tags ($ tags )
328302 ->get ($ key );
329303
0 commit comments