File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Illuminated \Testing \Asserts ;
4+
5+ use Illuminate \Foundation \AliasLoader ;
6+ use Illuminate \Support \Facades \Artisan ;
7+
8+ trait ServiceProviderAsserts
9+ {
10+ protected function assertCommandRegistered ($ name )
11+ {
12+ $ message = "Failed asserting that command ` {$ name }` is registered. " ;
13+ $ this ->assertArrayHasKey ($ name , Artisan::all (), $ message );
14+ }
15+
16+ protected function assertCommandNotRegistered ($ name )
17+ {
18+ $ message = "Failed asserting that command ` {$ name }` is not registered. " ;
19+ $ this ->assertArrayNotHasKey ($ name , Artisan::all (), $ message );
20+ }
21+
22+ protected function assertAliasRegistered ($ alias )
23+ {
24+ $ message = "Failed asserting that alias ` {$ alias }` is registered. " ;
25+ $ this ->assertTrue (AliasLoader::getInstance ()->load ($ alias ), $ message );
26+ }
27+
28+ protected function assertAliasNotRegistered ($ alias )
29+ {
30+ $ message = "Failed asserting that alias ` {$ alias }` is not registered. " ;
31+ $ this ->assertFalse (AliasLoader::getInstance ()->load ($ alias ), $ message );
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments