File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Foxws \UserCache \Events \ClearingUserCache ;
4
+ use Foxws \UserCache \Events \ClearedUserCache ;
5
+ use Foxws \UserCache \UserCacheRepository ;
6
+ use Illuminate \Cache \Repository ;
7
+ use Illuminate \Support \Facades \Artisan ;
8
+ use Illuminate \Support \Facades \Event ;
9
+
10
+ beforeEach (function () {
11
+ $ this ->createTaggableResponseCacheStore = function (): Repository {
12
+ // Simulating construction of Repository inside of the service provider
13
+ return $ this ->app ->contextual [UserCacheRepository::class][$ this ->app ->getAlias (Repository::class)]();
14
+ };
15
+ });
16
+
17
+ it ('will fire events when clearing the cache ' , function () {
18
+ Event::fake ();
19
+
20
+ Artisan::call ('usercache:clear ' );
21
+
22
+ Event::assertDispatched (ClearingUserCache::class);
23
+ Event::assertDispatched (ClearedUserCache::class);
24
+ });
You can’t perform that action at this time.
0 commit comments