File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bit \Skeleton \Tests \Unit ;
4+
5+ use Mockery ;
6+ use Mockery \MockInterface ;
7+ use Bit \Skeleton \Tests \TestCase ;
8+ use Illuminate \Filesystem \Filesystem ;
9+ use Bit \Skeleton \Generators \DomainGenerator ;
10+ use Bit \Skeleton \Exceptions \EntityAlreadyExistsException ;
11+
12+ class DomainGeneratorTest extends TestCase
13+ {
14+ public function test_can_generate_a_domain_when_it_does_not_exist ()
15+ {
16+ app (DomainGenerator::class)->generate ('FooBar ' );
17+
18+ $ domainExists = (new Filesystem )->exists (domain_path ('FooBar ' ));
19+
20+ $ this ->assertEquals (true , $ domainExists );
21+ }
22+
23+ public function test_cannot_generate_a_domain_when_it_already_exists ()
24+ {
25+ $ this ->expectException (EntityAlreadyExistsException::class);
26+ $ this ->expectExceptionMessage ('Domain already exists! ' );
27+
28+ app (DomainGenerator::class)->generate ('FooBar ' );
29+ app (DomainGenerator::class)->generate ('FooBar ' );
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments