@@ -23,43 +23,43 @@ |
||
23 | 23 | */ |
24 | 24 | final class CommandLazinessSupportTest extends KernelTestCase |
25 | 25 | { |
26 | - private StatefulService $service; |
|
26 | + private StatefulService $service; |
|
27 | 27 | |
28 | - protected function setUp(): void |
|
29 | - { |
|
30 | - self::bootKernel(); |
|
28 | + protected function setUp(): void |
|
29 | + { |
|
30 | + self::bootKernel(); |
|
31 | 31 | |
32 | - $this->service = self::$kernel->getContainer()->get(StatefulService::class); |
|
33 | - } |
|
32 | + $this->service = self::$kernel->getContainer()->get(StatefulService::class); |
|
33 | + } |
|
34 | 34 | |
35 | - public function test_it_is_instantiated_lazily(): void |
|
36 | - { |
|
37 | - // Sanity check |
|
38 | - self::assertFalse($this->service->called); |
|
35 | + public function test_it_is_instantiated_lazily(): void |
|
36 | + { |
|
37 | + // Sanity check |
|
38 | + self::assertFalse($this->service->called); |
|
39 | 39 | |
40 | - // Finding another command – if command is not lazy it will be loaded |
|
41 | - (new Application(self::$kernel))->find('app:foo'); |
|
40 | + // Finding another command – if command is not lazy it will be loaded |
|
41 | + (new Application(self::$kernel))->find('app:foo'); |
|
42 | 42 | |
43 | - /** @psalm-suppress RedundantConditionGivenDocblockType */ |
|
44 | - self::assertFalse($this->service->called); |
|
43 | + /** @psalm-suppress RedundantConditionGivenDocblockType */ |
|
44 | + self::assertFalse($this->service->called); |
|
45 | 45 | |
46 | - (new Application(self::$kernel))->find('app:lazy'); |
|
46 | + (new Application(self::$kernel))->find('app:lazy'); |
|
47 | 47 | |
48 | - /** @psalm-suppress DocblockTypeContradiction */ |
|
49 | - self::assertTrue($this->service->called); |
|
50 | - } |
|
48 | + /** @psalm-suppress DocblockTypeContradiction */ |
|
49 | + self::assertTrue($this->service->called); |
|
50 | + } |
|
51 | 51 | |
52 | - public function test_it_can_be_executed(): void |
|
53 | - { |
|
54 | - // Sanity check |
|
55 | - self::assertFalse($this->service->called); |
|
52 | + public function test_it_can_be_executed(): void |
|
53 | + { |
|
54 | + // Sanity check |
|
55 | + self::assertFalse($this->service->called); |
|
56 | 56 | |
57 | - $command = (new Application(self::$kernel))->find('app:lazy'); |
|
58 | - $tester = new CommandTester($command); |
|
57 | + $command = (new Application(self::$kernel))->find('app:lazy'); |
|
58 | + $tester = new CommandTester($command); |
|
59 | 59 | |
60 | - $tester->execute([], ['interactive' => false]); |
|
60 | + $tester->execute([], ['interactive' => false]); |
|
61 | 61 | |
62 | - /** @psalm-suppress DocblockTypeContradiction */ |
|
63 | - self::assertTrue($this->service->called); |
|
64 | - } |
|
62 | + /** @psalm-suppress DocblockTypeContradiction */ |
|
63 | + self::assertTrue($this->service->called); |
|
64 | + } |
|
65 | 65 | } |
@@ -21,8 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * @covers \Fidry\Console\Command\SymfonyCommand |
23 | 23 | */ |
24 | -final class CommandLazinessSupportTest extends KernelTestCase |
|
25 | -{ |
|
24 | +final class CommandLazinessSupportTest extends KernelTestCase { |
|
26 | 25 | private StatefulService $service; |
27 | 26 | |
28 | 27 | protected function setUp(): void |
@@ -24,28 +24,28 @@ |
||
24 | 24 | */ |
25 | 25 | final class CommandServiceInjectionSupportTest extends KernelTestCase |
26 | 26 | { |
27 | - private Command $command; |
|
28 | - private CommandTester $tester; |
|
29 | - private StatefulService $service; |
|
27 | + private Command $command; |
|
28 | + private CommandTester $tester; |
|
29 | + private StatefulService $service; |
|
30 | 30 | |
31 | - protected function setUp(): void |
|
32 | - { |
|
33 | - $kernel = self::bootKernel(); |
|
31 | + protected function setUp(): void |
|
32 | + { |
|
33 | + $kernel = self::bootKernel(); |
|
34 | 34 | |
35 | - $this->command = (new Application($kernel))->find('app:with-service'); |
|
36 | - $this->tester = new CommandTester($this->command); |
|
35 | + $this->command = (new Application($kernel))->find('app:with-service'); |
|
36 | + $this->tester = new CommandTester($this->command); |
|
37 | 37 | |
38 | - $this->service = $kernel->getContainer()->get(StatefulService::class); |
|
39 | - } |
|
38 | + $this->service = $kernel->getContainer()->get(StatefulService::class); |
|
39 | + } |
|
40 | 40 | |
41 | - public function test_it_can_be_executed(): void |
|
42 | - { |
|
43 | - // Sanity check |
|
44 | - self::assertFalse($this->service->called); |
|
41 | + public function test_it_can_be_executed(): void |
|
42 | + { |
|
43 | + // Sanity check |
|
44 | + self::assertFalse($this->service->called); |
|
45 | 45 | |
46 | - $this->tester->execute([], ['interactive' => false]); |
|
46 | + $this->tester->execute([], ['interactive' => false]); |
|
47 | 47 | |
48 | - /** @psalm-suppress DocblockTypeContradiction */ |
|
49 | - self::assertTrue($this->service->called); |
|
50 | - } |
|
48 | + /** @psalm-suppress DocblockTypeContradiction */ |
|
49 | + self::assertTrue($this->service->called); |
|
50 | + } |
|
51 | 51 | } |
@@ -22,8 +22,7 @@ |
||
22 | 22 | /** |
23 | 23 | * @covers \Fidry\Console\Command\SymfonyCommand |
24 | 24 | */ |
25 | -final class CommandServiceInjectionSupportTest extends KernelTestCase |
|
26 | -{ |
|
25 | +final class CommandServiceInjectionSupportTest extends KernelTestCase { |
|
27 | 26 | private Command $command; |
28 | 27 | private CommandTester $tester; |
29 | 28 | private StatefulService $service; |
@@ -25,52 +25,52 @@ |
||
25 | 25 | */ |
26 | 26 | final class CommandMetaDescriptionSupportTest extends KernelTestCase |
27 | 27 | { |
28 | - private Command $command; |
|
29 | - private CommandTester $tester; |
|
28 | + private Command $command; |
|
29 | + private CommandTester $tester; |
|
30 | 30 | |
31 | - protected function setUp(): void |
|
32 | - { |
|
33 | - $kernel = self::bootKernel(); |
|
31 | + protected function setUp(): void |
|
32 | + { |
|
33 | + $kernel = self::bootKernel(); |
|
34 | 34 | |
35 | - $this->command = (new Application($kernel))->find('app:foo'); |
|
36 | - $this->tester = new CommandTester($this->command); |
|
37 | - } |
|
35 | + $this->command = (new Application($kernel))->find('app:foo'); |
|
36 | + $this->tester = new CommandTester($this->command); |
|
37 | + } |
|
38 | 38 | |
39 | - public function test_it_supports_the_command_meta_description(): void |
|
40 | - { |
|
41 | - self::assertMatchesRegularExpression( |
|
42 | - '/^Command name: "app:foo", command full name: ".+ app:foo"$/', |
|
43 | - $this->command->getProcessedHelp(), |
|
44 | - ); |
|
39 | + public function test_it_supports_the_command_meta_description(): void |
|
40 | + { |
|
41 | + self::assertMatchesRegularExpression( |
|
42 | + '/^Command name: "app:foo", command full name: ".+ app:foo"$/', |
|
43 | + $this->command->getProcessedHelp(), |
|
44 | + ); |
|
45 | 45 | |
46 | - CommandAssertions::assertSameMetaDescription( |
|
47 | - $this->command, |
|
48 | - 'app:foo', |
|
49 | - 'Description content', |
|
50 | - $this->command->getProcessedHelp(), |
|
51 | - 'app:foo', |
|
52 | - ); |
|
53 | - } |
|
46 | + CommandAssertions::assertSameMetaDescription( |
|
47 | + $this->command, |
|
48 | + 'app:foo', |
|
49 | + 'Description content', |
|
50 | + $this->command->getProcessedHelp(), |
|
51 | + 'app:foo', |
|
52 | + ); |
|
53 | + } |
|
54 | 54 | |
55 | - public function test_it_can_be_executed_non_interactively(): void |
|
56 | - { |
|
57 | - $this->tester->execute([], ['interactive' => false]); |
|
55 | + public function test_it_can_be_executed_non_interactively(): void |
|
56 | + { |
|
57 | + $this->tester->execute([], ['interactive' => false]); |
|
58 | 58 | |
59 | - CommandAssertions::assertSameOutput( |
|
60 | - $this->tester, |
|
61 | - ExitCode::SUCCESS, |
|
62 | - '', |
|
63 | - ); |
|
64 | - } |
|
59 | + CommandAssertions::assertSameOutput( |
|
60 | + $this->tester, |
|
61 | + ExitCode::SUCCESS, |
|
62 | + '', |
|
63 | + ); |
|
64 | + } |
|
65 | 65 | |
66 | - public function test_it_can_be_executed_interactively(): void |
|
67 | - { |
|
68 | - $this->tester->execute([], ['interactive' => true]); |
|
66 | + public function test_it_can_be_executed_interactively(): void |
|
67 | + { |
|
68 | + $this->tester->execute([], ['interactive' => true]); |
|
69 | 69 | |
70 | - CommandAssertions::assertSameOutput( |
|
71 | - $this->tester, |
|
72 | - ExitCode::SUCCESS, |
|
73 | - '', |
|
74 | - ); |
|
75 | - } |
|
70 | + CommandAssertions::assertSameOutput( |
|
71 | + $this->tester, |
|
72 | + ExitCode::SUCCESS, |
|
73 | + '', |
|
74 | + ); |
|
75 | + } |
|
76 | 76 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @covers \Fidry\Console\Command\SymfonyCommand |
25 | 25 | */ |
26 | -final class CommandMetaDescriptionSupportTest extends KernelTestCase |
|
27 | -{ |
|
26 | +final class CommandMetaDescriptionSupportTest extends KernelTestCase { |
|
28 | 27 | private Command $command; |
29 | 28 | private CommandTester $tester; |
30 | 29 |
@@ -25,63 +25,63 @@ |
||
25 | 25 | */ |
26 | 26 | final class CommandArgumentsAndOptionsSupportTest extends KernelTestCase |
27 | 27 | { |
28 | - private Command $command; |
|
29 | - private CommandTester $tester; |
|
28 | + private Command $command; |
|
29 | + private CommandTester $tester; |
|
30 | 30 | |
31 | - protected function setUp(): void |
|
32 | - { |
|
33 | - $kernel = self::bootKernel(); |
|
31 | + protected function setUp(): void |
|
32 | + { |
|
33 | + $kernel = self::bootKernel(); |
|
34 | 34 | |
35 | - $this->command = (new Application($kernel))->find('app:print-arg-opt'); |
|
36 | - $this->tester = new CommandTester($this->command); |
|
37 | - } |
|
35 | + $this->command = (new Application($kernel))->find('app:print-arg-opt'); |
|
36 | + $this->tester = new CommandTester($this->command); |
|
37 | + } |
|
38 | 38 | |
39 | - public function test_it_supports_the_command_meta_description(): void |
|
40 | - { |
|
41 | - CommandAssertions::assertSameMetaDescription( |
|
42 | - $this->command, |
|
43 | - 'app:print-arg-opt', |
|
44 | - '', |
|
45 | - '', |
|
46 | - 'app:print-arg-opt [-o|--opt] [--] <arg>', |
|
47 | - ); |
|
48 | - self::assertSame('app:print-arg-opt', $this->command->getName()); |
|
49 | - } |
|
39 | + public function test_it_supports_the_command_meta_description(): void |
|
40 | + { |
|
41 | + CommandAssertions::assertSameMetaDescription( |
|
42 | + $this->command, |
|
43 | + 'app:print-arg-opt', |
|
44 | + '', |
|
45 | + '', |
|
46 | + 'app:print-arg-opt [-o|--opt] [--] <arg>', |
|
47 | + ); |
|
48 | + self::assertSame('app:print-arg-opt', $this->command->getName()); |
|
49 | + } |
|
50 | 50 | |
51 | - public function test_it_can_be_executed_without_an_option(): void |
|
52 | - { |
|
53 | - $this->tester->execute( |
|
54 | - ['arg' => 'Hello world!'], |
|
55 | - ['interactive' => false], |
|
56 | - ); |
|
51 | + public function test_it_can_be_executed_without_an_option(): void |
|
52 | + { |
|
53 | + $this->tester->execute( |
|
54 | + ['arg' => 'Hello world!'], |
|
55 | + ['interactive' => false], |
|
56 | + ); |
|
57 | 57 | |
58 | - CommandAssertions::assertSameOutput( |
|
59 | - $this->tester, |
|
60 | - ExitCode::SUCCESS, |
|
61 | - <<<'TEXT' |
|
58 | + CommandAssertions::assertSameOutput( |
|
59 | + $this->tester, |
|
60 | + ExitCode::SUCCESS, |
|
61 | + <<<'TEXT' |
|
62 | 62 | arg: Hello world!; opt: false |
63 | 63 | |
64 | 64 | TEXT, |
65 | - ); |
|
66 | - } |
|
65 | + ); |
|
66 | + } |
|
67 | 67 | |
68 | - public function test_it_can_be_executed_with_an_option(): void |
|
69 | - { |
|
70 | - $this->tester->execute( |
|
71 | - [ |
|
72 | - 'arg' => 'Hello world!', |
|
73 | - '--opt' => null, |
|
74 | - ], |
|
75 | - ['interactive' => false], |
|
76 | - ); |
|
68 | + public function test_it_can_be_executed_with_an_option(): void |
|
69 | + { |
|
70 | + $this->tester->execute( |
|
71 | + [ |
|
72 | + 'arg' => 'Hello world!', |
|
73 | + '--opt' => null, |
|
74 | + ], |
|
75 | + ['interactive' => false], |
|
76 | + ); |
|
77 | 77 | |
78 | - CommandAssertions::assertSameOutput( |
|
79 | - $this->tester, |
|
80 | - ExitCode::SUCCESS, |
|
81 | - <<<'TEXT' |
|
78 | + CommandAssertions::assertSameOutput( |
|
79 | + $this->tester, |
|
80 | + ExitCode::SUCCESS, |
|
81 | + <<<'TEXT' |
|
82 | 82 | arg: Hello world!; opt: true |
83 | 83 | |
84 | 84 | TEXT, |
85 | - ); |
|
86 | - } |
|
85 | + ); |
|
86 | + } |
|
87 | 87 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @covers \Fidry\Console\Command\SymfonyCommand |
25 | 25 | */ |
26 | -final class CommandArgumentsAndOptionsSupportTest extends KernelTestCase |
|
27 | -{ |
|
26 | +final class CommandArgumentsAndOptionsSupportTest extends KernelTestCase { |
|
28 | 27 | private Command $command; |
29 | 28 | private CommandTester $tester; |
30 | 29 |
@@ -25,28 +25,28 @@ |
||
25 | 25 | */ |
26 | 26 | final class CommandAwarenessSupportTest extends KernelTestCase |
27 | 27 | { |
28 | - private Command $command; |
|
29 | - private CommandTester $tester; |
|
30 | - private StatefulService $service; |
|
28 | + private Command $command; |
|
29 | + private CommandTester $tester; |
|
30 | + private StatefulService $service; |
|
31 | 31 | |
32 | - protected function setUp(): void |
|
33 | - { |
|
34 | - $kernel = self::bootKernel(); |
|
32 | + protected function setUp(): void |
|
33 | + { |
|
34 | + $kernel = self::bootKernel(); |
|
35 | 35 | |
36 | - $this->command = (new Application($kernel))->find('app:cmd-aware'); |
|
37 | - $this->tester = new CommandTester($this->command); |
|
36 | + $this->command = (new Application($kernel))->find('app:cmd-aware'); |
|
37 | + $this->tester = new CommandTester($this->command); |
|
38 | 38 | |
39 | - $this->service = $kernel->getContainer()->get(StatefulService::class); |
|
40 | - } |
|
39 | + $this->service = $kernel->getContainer()->get(StatefulService::class); |
|
40 | + } |
|
41 | 41 | |
42 | - public function test_it_can_be_executed(): void |
|
43 | - { |
|
44 | - // Sanity check |
|
45 | - self::assertFalse($this->service->called); |
|
42 | + public function test_it_can_be_executed(): void |
|
43 | + { |
|
44 | + // Sanity check |
|
45 | + self::assertFalse($this->service->called); |
|
46 | 46 | |
47 | - $this->tester->execute([], ['interactive' => false]); |
|
47 | + $this->tester->execute([], ['interactive' => false]); |
|
48 | 48 | |
49 | - /** @psalm-suppress DocblockTypeContradiction */ |
|
50 | - self::assertTrue($this->service->called); |
|
51 | - } |
|
49 | + /** @psalm-suppress DocblockTypeContradiction */ |
|
50 | + self::assertTrue($this->service->called); |
|
51 | + } |
|
52 | 52 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | * @covers \Fidry\Console\Command\CommandAwareness |
24 | 24 | * @covers \Fidry\Console\Command\SymfonyCommand |
25 | 25 | */ |
26 | -final class CommandAwarenessSupportTest extends KernelTestCase |
|
27 | -{ |
|
26 | +final class CommandAwarenessSupportTest extends KernelTestCase { |
|
28 | 27 | private Command $command; |
29 | 28 | private CommandTester $tester; |
30 | 29 | private StatefulService $service; |
@@ -22,12 +22,12 @@ |
||
22 | 22 | */ |
23 | 23 | final class CommandHelperInjectionSupportTest extends KernelTestCase |
24 | 24 | { |
25 | - public function test_it_can_be_instantiated(): void |
|
26 | - { |
|
27 | - $kernel = self::bootKernel(); |
|
25 | + public function test_it_can_be_instantiated(): void |
|
26 | + { |
|
27 | + $kernel = self::bootKernel(); |
|
28 | 28 | |
29 | - $command = (new Application($kernel))->find('app:helpers'); |
|
29 | + $command = (new Application($kernel))->find('app:helpers'); |
|
30 | 30 | |
31 | - self::assertInstanceOf(SymfonyCommand::class, $command); |
|
32 | - } |
|
31 | + self::assertInstanceOf(SymfonyCommand::class, $command); |
|
32 | + } |
|
33 | 33 | } |
@@ -20,8 +20,7 @@ |
||
20 | 20 | /** |
21 | 21 | * @covers \Fidry\Console\Command\SymfonyCommand |
22 | 22 | */ |
23 | -final class CommandHelperInjectionSupportTest extends KernelTestCase |
|
24 | -{ |
|
23 | +final class CommandHelperInjectionSupportTest extends KernelTestCase { |
|
25 | 24 | public function test_it_can_be_instantiated(): void |
26 | 25 | { |
27 | 26 | $kernel = self::bootKernel(); |
@@ -26,41 +26,41 @@ |
||
26 | 26 | */ |
27 | 27 | final class CommandFullLifeCycleSupportTest extends KernelTestCase |
28 | 28 | { |
29 | - private Command $command; |
|
30 | - private CommandTester $tester; |
|
29 | + private Command $command; |
|
30 | + private CommandTester $tester; |
|
31 | 31 | |
32 | - protected function setUp(): void |
|
33 | - { |
|
34 | - $kernel = self::bootKernel(); |
|
32 | + protected function setUp(): void |
|
33 | + { |
|
34 | + $kernel = self::bootKernel(); |
|
35 | 35 | |
36 | - $this->command = (new Application($kernel))->find('app:full-life-cycle'); |
|
37 | - $this->tester = new CommandTester($this->command); |
|
38 | - } |
|
36 | + $this->command = (new Application($kernel))->find('app:full-life-cycle'); |
|
37 | + $this->tester = new CommandTester($this->command); |
|
38 | + } |
|
39 | 39 | |
40 | - public function test_it_can_be_executed(): void |
|
41 | - { |
|
42 | - $this->tester->setInputs(['username' => 'Jean']); |
|
40 | + public function test_it_can_be_executed(): void |
|
41 | + { |
|
42 | + $this->tester->setInputs(['username' => 'Jean']); |
|
43 | 43 | |
44 | - $this->tester->execute([], ['interactive' => true]); |
|
44 | + $this->tester->execute([], ['interactive' => true]); |
|
45 | 45 | |
46 | - CommandAssertions::assertSameOutput( |
|
47 | - $this->tester, |
|
48 | - ExitCode::SUCCESS, |
|
49 | - <<<'TEXT' |
|
46 | + CommandAssertions::assertSameOutput( |
|
47 | + $this->tester, |
|
48 | + ExitCode::SUCCESS, |
|
49 | + <<<'TEXT' |
|
50 | 50 | Please choose a username: |
51 | 51 | Jean |
52 | 52 | |
53 | 53 | TEXT, |
54 | - ); |
|
55 | - } |
|
54 | + ); |
|
55 | + } |
|
56 | 56 | |
57 | - public function test_it_ignores_interact_if_input_is_not_interactive(): void |
|
58 | - { |
|
59 | - $this->tester->setInputs(['username' => 'Jean']); |
|
57 | + public function test_it_ignores_interact_if_input_is_not_interactive(): void |
|
58 | + { |
|
59 | + $this->tester->setInputs(['username' => 'Jean']); |
|
60 | 60 | |
61 | - $this->expectException(RuntimeException::class); |
|
62 | - $this->expectErrorMessage('Not enough arguments (missing: "username")'); |
|
61 | + $this->expectException(RuntimeException::class); |
|
62 | + $this->expectErrorMessage('Not enough arguments (missing: "username")'); |
|
63 | 63 | |
64 | - $this->tester->execute([], ['interactive' => false]); |
|
65 | - } |
|
64 | + $this->tester->execute([], ['interactive' => false]); |
|
65 | + } |
|
66 | 66 | } |
@@ -24,8 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * @covers \Fidry\Console\Command\SymfonyCommand |
26 | 26 | */ |
27 | -final class CommandFullLifeCycleSupportTest extends KernelTestCase |
|
28 | -{ |
|
27 | +final class CommandFullLifeCycleSupportTest extends KernelTestCase { |
|
29 | 28 | private Command $command; |
30 | 29 | private CommandTester $tester; |
31 | 30 |
@@ -23,89 +23,89 @@ |
||
23 | 23 | */ |
24 | 24 | final class ConfigurationTest extends TestCase |
25 | 25 | { |
26 | - public function test_it_can_be_instantiated_with_minimum_params(): void |
|
27 | - { |
|
28 | - $configuration = new Configuration( |
|
29 | - $name = 'app:foo', |
|
30 | - $description = 'description', |
|
31 | - $help = 'help', |
|
32 | - ); |
|
26 | + public function test_it_can_be_instantiated_with_minimum_params(): void |
|
27 | + { |
|
28 | + $configuration = new Configuration( |
|
29 | + $name = 'app:foo', |
|
30 | + $description = 'description', |
|
31 | + $help = 'help', |
|
32 | + ); |
|
33 | 33 | |
34 | - self::assertStateIs( |
|
35 | - $configuration, |
|
36 | - $name, |
|
37 | - $description, |
|
38 | - $help, |
|
39 | - [], |
|
40 | - [], |
|
41 | - ); |
|
42 | - } |
|
34 | + self::assertStateIs( |
|
35 | + $configuration, |
|
36 | + $name, |
|
37 | + $description, |
|
38 | + $help, |
|
39 | + [], |
|
40 | + [], |
|
41 | + ); |
|
42 | + } |
|
43 | 43 | |
44 | - public function test_it_can_be_instantiated_without_arguments_or_options(): void |
|
45 | - { |
|
46 | - $configuration = new Configuration( |
|
47 | - $name = 'app:foo', |
|
48 | - $description = 'description', |
|
49 | - $help = 'help', |
|
50 | - $arguments = [], |
|
51 | - $options = [], |
|
52 | - ); |
|
44 | + public function test_it_can_be_instantiated_without_arguments_or_options(): void |
|
45 | + { |
|
46 | + $configuration = new Configuration( |
|
47 | + $name = 'app:foo', |
|
48 | + $description = 'description', |
|
49 | + $help = 'help', |
|
50 | + $arguments = [], |
|
51 | + $options = [], |
|
52 | + ); |
|
53 | 53 | |
54 | - self::assertStateIs( |
|
55 | - $configuration, |
|
56 | - $name, |
|
57 | - $description, |
|
58 | - $help, |
|
59 | - $arguments, |
|
60 | - $options, |
|
61 | - ); |
|
62 | - } |
|
54 | + self::assertStateIs( |
|
55 | + $configuration, |
|
56 | + $name, |
|
57 | + $description, |
|
58 | + $help, |
|
59 | + $arguments, |
|
60 | + $options, |
|
61 | + ); |
|
62 | + } |
|
63 | 63 | |
64 | - public function test_it_can_be_instantiated_with_arguments_or_options(): void |
|
65 | - { |
|
66 | - $configuration = new Configuration( |
|
67 | - $name = 'app:foo', |
|
68 | - $description = 'description', |
|
69 | - $help = 'help', |
|
70 | - $arguments = [ |
|
71 | - new InputArgument( |
|
72 | - 'arg', |
|
73 | - InputArgument::REQUIRED, |
|
74 | - 'arg description', |
|
75 | - ), |
|
76 | - ], |
|
77 | - $options = [ |
|
78 | - new InputOption( |
|
79 | - 'opt', |
|
80 | - 'o', |
|
81 | - InputOption::VALUE_NONE, |
|
82 | - 'option description', |
|
83 | - ), |
|
84 | - ], |
|
85 | - ); |
|
64 | + public function test_it_can_be_instantiated_with_arguments_or_options(): void |
|
65 | + { |
|
66 | + $configuration = new Configuration( |
|
67 | + $name = 'app:foo', |
|
68 | + $description = 'description', |
|
69 | + $help = 'help', |
|
70 | + $arguments = [ |
|
71 | + new InputArgument( |
|
72 | + 'arg', |
|
73 | + InputArgument::REQUIRED, |
|
74 | + 'arg description', |
|
75 | + ), |
|
76 | + ], |
|
77 | + $options = [ |
|
78 | + new InputOption( |
|
79 | + 'opt', |
|
80 | + 'o', |
|
81 | + InputOption::VALUE_NONE, |
|
82 | + 'option description', |
|
83 | + ), |
|
84 | + ], |
|
85 | + ); |
|
86 | 86 | |
87 | - self::assertStateIs( |
|
88 | - $configuration, |
|
89 | - $name, |
|
90 | - $description, |
|
91 | - $help, |
|
92 | - $arguments, |
|
93 | - $options, |
|
94 | - ); |
|
95 | - } |
|
87 | + self::assertStateIs( |
|
88 | + $configuration, |
|
89 | + $name, |
|
90 | + $description, |
|
91 | + $help, |
|
92 | + $arguments, |
|
93 | + $options, |
|
94 | + ); |
|
95 | + } |
|
96 | 96 | |
97 | - private static function assertStateIs( |
|
98 | - Configuration $configuration, |
|
99 | - string $expectedName, |
|
100 | - string $expectedDescription, |
|
101 | - string $expectedHelp, |
|
102 | - array $expectedArguments, |
|
103 | - array $expectedOptions |
|
104 | - ): void { |
|
105 | - self::assertSame($expectedName, $configuration->getName()); |
|
106 | - self::assertSame($expectedDescription, $configuration->getDescription()); |
|
107 | - self::assertSame($expectedHelp, $configuration->getHelp()); |
|
108 | - self::assertEquals($expectedArguments, $configuration->getArguments()); |
|
109 | - self::assertEquals($expectedOptions, $configuration->getOptions()); |
|
110 | - } |
|
97 | + private static function assertStateIs( |
|
98 | + Configuration $configuration, |
|
99 | + string $expectedName, |
|
100 | + string $expectedDescription, |
|
101 | + string $expectedHelp, |
|
102 | + array $expectedArguments, |
|
103 | + array $expectedOptions |
|
104 | + ): void { |
|
105 | + self::assertSame($expectedName, $configuration->getName()); |
|
106 | + self::assertSame($expectedDescription, $configuration->getDescription()); |
|
107 | + self::assertSame($expectedHelp, $configuration->getHelp()); |
|
108 | + self::assertEquals($expectedArguments, $configuration->getArguments()); |
|
109 | + self::assertEquals($expectedOptions, $configuration->getOptions()); |
|
110 | + } |
|
111 | 111 | } |
@@ -21,8 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * @covers \Fidry\Console\Command\Configuration |
23 | 23 | */ |
24 | -final class ConfigurationTest extends TestCase |
|
25 | -{ |
|
24 | +final class ConfigurationTest extends TestCase { |
|
26 | 25 | public function test_it_can_be_instantiated_with_minimum_params(): void |
27 | 26 | { |
28 | 27 | $configuration = new Configuration( |
@@ -19,29 +19,29 @@ |
||
19 | 19 | |
20 | 20 | final class CommandAssertions |
21 | 21 | { |
22 | - private function __construct() |
|
23 | - { |
|
24 | - } |
|
22 | + private function __construct() |
|
23 | + { |
|
24 | + } |
|
25 | 25 | |
26 | - public static function assertSameMetaDescription( |
|
27 | - Command $command, |
|
28 | - string $expectedName, |
|
29 | - string $expectedDescription, |
|
30 | - string $expectedHelp, |
|
31 | - string $expectedSynopsis |
|
32 | - ): void { |
|
33 | - Assert::assertSame($expectedName, $command->getName()); |
|
34 | - Assert::assertSame($expectedDescription, $command->getDescription()); |
|
35 | - Assert::assertSame($expectedHelp, $command->getProcessedHelp()); |
|
36 | - Assert::assertSame($expectedSynopsis, $command->getSynopsis()); |
|
37 | - } |
|
26 | + public static function assertSameMetaDescription( |
|
27 | + Command $command, |
|
28 | + string $expectedName, |
|
29 | + string $expectedDescription, |
|
30 | + string $expectedHelp, |
|
31 | + string $expectedSynopsis |
|
32 | + ): void { |
|
33 | + Assert::assertSame($expectedName, $command->getName()); |
|
34 | + Assert::assertSame($expectedDescription, $command->getDescription()); |
|
35 | + Assert::assertSame($expectedHelp, $command->getProcessedHelp()); |
|
36 | + Assert::assertSame($expectedSynopsis, $command->getSynopsis()); |
|
37 | + } |
|
38 | 38 | |
39 | - public static function assertSameOutput( |
|
40 | - CommandTester $executedCommand, |
|
41 | - int $expectedExitCode, |
|
42 | - string $expectedDisplay |
|
43 | - ): void { |
|
44 | - Assert::assertSame($expectedExitCode, $executedCommand->getStatusCode()); |
|
45 | - Assert::assertSame($expectedDisplay, $executedCommand->getDisplay(true)); |
|
46 | - } |
|
39 | + public static function assertSameOutput( |
|
40 | + CommandTester $executedCommand, |
|
41 | + int $expectedExitCode, |
|
42 | + string $expectedDisplay |
|
43 | + ): void { |
|
44 | + Assert::assertSame($expectedExitCode, $executedCommand->getStatusCode()); |
|
45 | + Assert::assertSame($expectedDisplay, $executedCommand->getDisplay(true)); |
|
46 | + } |
|
47 | 47 | } |
@@ -17,8 +17,7 @@ |
||
17 | 17 | use Symfony\Component\Console\Command\Command; |
18 | 18 | use Symfony\Component\Console\Tester\CommandTester; |
19 | 19 | |
20 | -final class CommandAssertions |
|
21 | -{ |
|
20 | +final class CommandAssertions { |
|
22 | 21 | private function __construct() |
23 | 22 | { |
24 | 23 | } |