File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed
Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bit \Skeleton \Tests \Cli ;
4+
5+ use Bit \Skeleton \Tests \TestCase ;
6+
7+ class DomainsTest extends TestCase
8+ {
9+ public function test_can_execute_domain_make_command_when_it_does_not_exist ()
10+ {
11+ $ this ->artisan ('bit.domain:make FooBar ' )
12+ ->expectsOutput ('Domain created successfully! ' )
13+ ->assertSuccessful ();
14+ }
15+
16+ public function test_cannot_execute_domain_make_command_when_it_already_exists ()
17+ {
18+ $ this ->artisan ('bit.domain:make FooBar ' );
19+ $ this ->artisan ('bit.domain:make FooBar ' )
20+ ->expectsOutput ('Domain already exists! ' )
21+ ->assertFailed ();
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bit \Skeleton \Tests \Cli ;
4+
5+ use Bit \Skeleton \Tests \TestCase ;
6+
7+ class JobsTest extends TestCase
8+ {
9+ public function test_can_execute_job_make_command_when_it_does_not_exist ()
10+ {
11+ $ this ->artisan ('bit.domain:make FooBar ' );
12+ $ this ->artisan ('bit.job:make FooJob -D FooBar ' )
13+ ->expectsOutput ('Job created successfully! ' )
14+ ->assertSuccessful ();
15+ }
16+
17+ public function test_cannot_execute_job_make_command_when_missing_domain_option ()
18+ {
19+ $ this ->artisan ('bit.job:make FooJob ' )
20+ ->expectsOutput ('Domain option is required! ' )
21+ ->assertFailed ();
22+ }
23+
24+ public function test_cannot_execute_job_make_command_when_it_already_exists ()
25+ {
26+ $ this ->artisan ('bit.domain:make FooBar ' );
27+ $ this ->artisan ('bit.job:make FooJob -D FooBar ' );
28+ $ this ->artisan ('bit.job:make FooJob -D FooBar ' )
29+ ->expectsOutput ('Job already exists! ' )
30+ ->assertFailed ();
31+ }
32+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public function setUp(): void
1818 public function tearDown (): void
1919 {
2020 (new Filesystem )->cleanDirectory (service_path ());
21+ (new Filesystem )->cleanDirectory (domain_path ());
2122 Mockery::close ();
2223 }
2324
You can’t perform that action at this time.
0 commit comments