File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,24 @@ public function testScopeDisablesCachingWhenCalledOnModel()
7171 $ this ->assertNotEquals ($ authors , $ cachedResults );
7272 }
7373
74+ public function testScopeDisableCacheDoesntCrashWhenCachingIsDisabledInConfig ()
75+ {
76+ config (['laravel-model-caching.disabled ' => true ]);
77+ $ key = sha1 ('genealabs:laravel-model-caching:genealabslaravelmodelcachingtestsfixturesauthor ' );
78+ $ tags = ['genealabs:laravel-model-caching:genealabslaravelmodelcachingtestsfixturesauthor ' ];
79+ $ authors = (new PrefixedAuthor )
80+ ->where ("name " , "Bruno " )
81+ ->disableCache ()
82+ ->get ();
83+
84+ $ cachedResults = $ this ->cache ()
85+ ->tags ($ tags )
86+ ->get ($ key )['value ' ];
87+
88+ $ this ->assertNull ($ cachedResults );
89+ $ this ->assertNotEquals ($ authors , $ cachedResults );
90+ }
91+
7492 public function testAllMethodCachingCanBeDisabledViaConfig ()
7593 {
7694 config (['laravel-model-caching.disabled ' => true ]);
You can’t perform that action at this time.
0 commit comments