88use Maartenpaauw \Specifications \Commands \MakeSpecificationCommand ;
99use Maartenpaauw \Specifications \Tests \TestCase ;
1010use Spatie \Snapshots \MatchesSnapshots ;
11- use Symfony \Component \Console \Command \Command ;
1211
1312class MakeSpecificationCommandTest extends TestCase
1413{
@@ -17,51 +16,66 @@ class MakeSpecificationCommandTest extends TestCase
1716 /** @test */
1817 public function it_should_be_possible_to_create_a_basic_specification_class (): void
1918 {
20- // Act
19+ // Arrange
2120 /** @var PendingCommand $command */
2221 $ command = $ this ->artisan (MakeSpecificationCommand::class, [
2322 'name ' => 'MyBasicSpecification ' ,
2423 ]);
2524
2625 // Assert
27- $ command ->assertExitCode (Command::SUCCESS );
26+ $ command ->assertSuccessful ();
27+
28+ // Act
29+ $ command ->execute ();
30+
31+ // Assert
2832 $ this ->assertSpecificationMatchesSnapshot ('MyBasicSpecification ' );
2933 }
3034
3135 /** @test */
3236 public function it_should_be_possible_to_create_a_composite_specification_class (): void
3337 {
34- // Act
38+ // Arrange
3539 /** @var PendingCommand $command */
3640 $ command = $ this ->artisan (MakeSpecificationCommand::class, [
3741 'name ' => 'MyCompositeSpecification ' ,
3842 '--composite ' => true ,
3943 ]);
4044
4145 // Assert
42- $ command ->assertExitCode (Command::SUCCESS );
46+ $ command ->assertSuccessful ();
47+
48+ // Act
49+ $ command ->execute ();
50+
51+ // Assert
4352 $ this ->assertSpecificationMatchesSnapshot ('MyCompositeSpecification ' );
4453 }
4554
4655 /** @test */
4756 public function it_should_be_possible_to_create_a_basic_specification_with_a_candidate_type (): void
4857 {
49- // Act
58+ // Arrange
5059 /** @var PendingCommand $command */
5160 $ command = $ this ->artisan (MakeSpecificationCommand::class, [
5261 'name ' => 'MyStrictBasicSpecification ' ,
5362 '--candidate ' => 'string ' ,
5463 ]);
5564
5665 // Assert
57- $ command ->assertExitCode (Command::SUCCESS );
66+ $ command ->assertSuccessful ();
67+
68+ // Act
69+ $ command ->execute ();
70+
71+ // Assert
5872 $ this ->assertSpecificationMatchesSnapshot ('MyStrictBasicSpecification ' );
5973 }
6074
6175 /** @test */
6276 public function it_should_be_possible_to_create_a_composite_specification_with_a_candidate_type (): void
6377 {
64- // Act
78+ // Arrange
6579 /** @var PendingCommand $command */
6680 $ command = $ this ->artisan (MakeSpecificationCommand::class, [
6781 'name ' => 'MyStrictCompositeSpecification ' ,
@@ -70,7 +84,12 @@ public function it_should_be_possible_to_create_a_composite_specification_with_a
7084 ]);
7185
7286 // Assert
73- $ command ->assertExitCode (Command::SUCCESS );
87+ $ command ->assertSuccessful ();
88+
89+ // Act
90+ $ command ->execute ();
91+
92+ // Assert
7493 $ this ->assertSpecificationMatchesSnapshot ('MyStrictCompositeSpecification ' );
7594 }
7695
0 commit comments