File tree 3 files changed +3
-10
lines changed
3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 7
7
use EriBloo \CacheObjects \Commands \MakeCacheObject ;
8
8
use EriBloo \CacheObjects \Contracts \CacheObjectDriver ;
9
9
use EriBloo \CacheObjects \Drivers \CacheDriver ;
10
- use Illuminate \Contracts \Cache \Store ;
11
10
use Illuminate \Foundation \Application ;
12
11
use Spatie \LaravelPackageTools \Package ;
13
12
use Spatie \LaravelPackageTools \PackageServiceProvider ;
@@ -27,7 +26,7 @@ public function configurePackage(Package $package): void
27
26
->hasConfigFile ();
28
27
29
28
$ this ->app ->scoped (CacheObjectDriver::class, function (Application $ app ) {
30
- return new CacheDriver ($ app ->make (Store::class ));
29
+ return new CacheDriver ($ app ->make (' cache ' )-> getStore ( ));
31
30
});
32
31
}
33
32
}
Original file line number Diff line number Diff line change 56
56
$ obj ->store ('test ' );
57
57
58
58
// assert
59
- assertEquals (serialize ('test ' ), Crypt::decryptString (app ( ' store ' )->get ((string ) $ obj ->key ())));
59
+ assertEquals (serialize ('test ' ), Crypt::decryptString (cache ( )->get ((string ) $ obj ->key ())));
60
60
assertEquals ('test ' , $ obj ->retrieve ());
61
61
});
62
62
Original file line number Diff line number Diff line change 7
7
use Cache ;
8
8
use Config ;
9
9
use EriBloo \CacheObjects \CacheObjectsServiceProvider ;
10
- use EriBloo \CacheObjects \Contracts \CacheObjectDriver ;
11
- use EriBloo \CacheObjects \Drivers \CacheDriver ;
12
- use Illuminate \Cache \ArrayStore ;
13
10
use Illuminate \Database \Eloquent \Factories \Factory ;
14
11
use Orchestra \Testbench \TestCase as Orchestra ;
15
12
@@ -25,10 +22,7 @@ protected function setUp(): void
25
22
) . 'Factory ' ,
26
23
);
27
24
28
- $ store = new ArrayStore ;
29
- $ this ->app ?->instance('store ' , $ store );
30
- $ this ->app ?->instance(CacheObjectDriver::class, new CacheDriver ($ store ));
31
-
25
+ Cache::setDefaultDriver ('array ' );
32
26
Config::set ('app.key ' , random_bytes (32 ));
33
27
Config::set ('app.cipher ' , 'aes-256-cbc ' );
34
28
}
You can’t perform that action at this time.
0 commit comments