File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
tests/Unit/Console/Commands Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ public function handle()
1212 $ option = $ this ->option ('model ' );
1313 $ model = new $ option ;
1414 $ model ->flushCache ();
15+ $ this ->info ("Cache for model ' {$ option }' flushed. " );
1516 }
1617}
Original file line number Diff line number Diff line change 1- <?php namespace GeneaLabs \LaravelModelCaching \Tests \Unit ;
1+ <?php namespace GeneaLabs \LaravelModelCaching \Tests \Unit \ Console \ Commands ;
22
33use GeneaLabs \LaravelModelCaching \Tests \Fixtures \Author ;
44use GeneaLabs \LaravelModelCaching \Tests \Fixtures \Book ;
@@ -48,13 +48,14 @@ public function testGivenModelIsFlushed()
4848 $ cachedResults = cache ()
4949 ->tags ($ tags )
5050 ->get ($ key );
51- $ this ->artisan ('modelCache:flush ' , ['--model ' => Author::class]);
51+ $ result = $ this ->artisan ('modelCache:flush ' , ['--model ' => Author::class]);
5252 $ flushedResults = cache ()
5353 ->tags ($ tags )
5454 ->get ($ key );
5555
5656 $ this ->assertEquals ($ authors , $ cachedResults );
5757 $ this ->assertEmpty ($ flushedResults );
58+ $ this ->assertEquals ($ result , 0 );
5859 }
5960
6061 public function testGivenModelWithRelationshipIsFlushed ()
@@ -69,12 +70,16 @@ public function testGivenModelWithRelationshipIsFlushed()
6970 $ cachedResults = cache ()
7071 ->tags ($ tags )
7172 ->get ($ key );
72- $ this ->artisan ('modelCache:flush ' , ['--model ' => Author::class]);
73+ $ result = $ this ->artisan (
74+ 'modelCache:flush ' ,
75+ ['--model ' => Author::class]
76+ );
7377 $ flushedResults = cache ()
7478 ->tags ($ tags )
7579 ->get ($ key );
7680
7781 $ this ->assertEquals ($ authors , $ cachedResults );
7882 $ this ->assertEmpty ($ flushedResults );
83+ $ this ->assertEquals ($ result , 0 );
7984 }
8085}
You can’t perform that action at this time.
0 commit comments