@@ -318,6 +318,26 @@ public function testMaxModelResultsCreatesCache()
318318 $ this ->assertEquals ($ liveResult , $ cachedResult );
319319 }
320320
321+ public function testRawMaxModelResultsCreatesCache ()
322+ {
323+ $ authorId = (new Author )->with ('books ' , 'profile ' )
324+ ->max (new Expression ('id + id ' ));
325+ $ key = sha1 ("genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-authors.deleted_at_null-testing: {$ this ->testingSqlitePath }testing.sqlite:books-testing: {$ this ->testingSqlitePath }testing.sqlite:profile-max_id + id " );
326+ $ tags = [
327+ "genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor " ,
328+ "genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:genealabslaravelmodelcachingtestsfixturesbook " ,
329+ "genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:genealabslaravelmodelcachingtestsfixturesprofile " ,
330+ ];
331+
332+ $ cachedResult = $ this ->cache ()->tags ($ tags )
333+ ->get ($ key )['value ' ];
334+ $ liveResult = (new UncachedAuthor )->with ('books ' , 'profile ' )
335+ ->max (new Expression ('id + id ' ));
336+
337+ $ this ->assertEquals ($ authorId , $ cachedResult );
338+ $ this ->assertEquals ($ liveResult , $ cachedResult );
339+ }
340+
321341 public function testMinModelResultsCreatesCache ()
322342 {
323343 $ authorId = (new Author )->with ('books ' , 'profile ' )
@@ -338,6 +358,26 @@ public function testMinModelResultsCreatesCache()
338358 $ this ->assertEquals ($ liveResult , $ cachedResult );
339359 }
340360
361+ public function testRawMinModelResultsCreatesCache ()
362+ {
363+ $ authorId = (new Author )->with ('books ' , 'profile ' )
364+ ->min (new Expression ('id + id ' ));
365+ $ key = sha1 ("genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-authors.deleted_at_null-testing: {$ this ->testingSqlitePath }testing.sqlite:books-testing: {$ this ->testingSqlitePath }testing.sqlite:profile-min_id + id " );
366+ $ tags = [
367+ "genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor " ,
368+ "genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:genealabslaravelmodelcachingtestsfixturesbook " ,
369+ "genealabs:laravel-model-caching:testing: {$ this ->testingSqlitePath }testing.sqlite:genealabslaravelmodelcachingtestsfixturesprofile " ,
370+ ];
371+
372+ $ cachedResult = $ this ->cache ()->tags ($ tags )
373+ ->get ($ key )['value ' ];
374+ $ liveResult = (new UncachedAuthor )->with ('books ' , 'profile ' )
375+ ->min (new Expression ('id + id ' ));
376+
377+ $ this ->assertEquals ($ authorId , $ cachedResult );
378+ $ this ->assertEquals ($ liveResult , $ cachedResult );
379+ }
380+
341381 public function testPluckModelResultsCreatesCache ()
342382 {
343383 $ authors = (new Author )->with ('books ' , 'profile ' )
0 commit comments