diff --git a/bin/generate-tests.php b/bin/generate-tests.php index bf4831dc..7bc291ef 100755 --- a/bin/generate-tests.php +++ b/bin/generate-tests.php @@ -145,7 +145,7 @@ add_test(['enabled:hello', '--context', 'production'], 'EnabledInProduction'); add_test(['list', '--raw', '--format', 'txt', '--short'], 'ListTest', skipOnBinary: true); add_test(['parallel:sleep', '--sleep5', '0', '--sleep7', '0', '--sleep10', '0'], 'ParallelSleepTest'); -add_test(['symfony:greet', 'World', '--french', 'COUCOU', '--punctuation', '!' ], 'SymfonyGreetTest', skipOnBinary: true); +add_test(['symfony:greet', 'World', '--french', 'COUCOU', '--punctuation', '!'], 'SymfonyGreetTest', skipOnBinary: true); add_test(['symfony:hello'], 'SymfonyHelloTest', skipOnBinary: true); // In /tmp add_test(['completion', 'bash'], 'NoConfigCompletionTest', '/tmp'); @@ -174,6 +174,8 @@ function add_test(array $args, string $class, ?string $cwd = null, bool $needRem ); $process->run(); + $err = OutputCleaner::cleanOutput($process->getErrorOutput()); + $code = strtr($template, [ '{{ class_name }}' => $class, '{{ task }}' => $args[0] ?? 'no task', @@ -184,18 +186,25 @@ function add_test(array $args, string $class, ?string $cwd = null, bool $needRem '{{ skip-on-binary }}' => match ($skipOnBinary) { true => <<<'PHP' - if (self::$binary) { - $this->markTestSkipped('This test is not compatible with the binary version of Castor.'); - } + if (self::$binary) { + $this->markTestSkipped('This test is not compatible with the binary version of Castor.'); + } - PHP, + PHP, default => '', }, + '{{ error-assertion }}' => match ((bool) $err) { + true => <<<'PHP' + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); + PHP, + default => <<<'PHP' + $this->assertSame('', $process->getErrorOutput()); + PHP, + }, ]); file_put_contents(__DIR__ . '/../tests/Examples/Generated/' . $class . '.php', $code); file_put_contents(__DIR__ . '/../tests/Examples/Generated/' . $class . '.php.output.txt', OutputCleaner::cleanOutput($process->getOutput())); - $err = OutputCleaner::cleanOutput($process->getErrorOutput()); if ($err) { file_put_contents(__DIR__ . '/../tests/Examples/Generated/' . $class . '.php.err.txt', $err); } @@ -217,10 +226,6 @@ public function test(): void $this->assertSame({{ exitCode }}, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + {{ error-assertion }} } } diff --git a/examples/symfony.php b/examples/symfony.php index 9cac474b..385675c9 100755 --- a/examples/symfony.php +++ b/examples/symfony.php @@ -15,7 +15,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand('hello', 'Says hello from a symfony application')] -#[AsSymfonyTask(name: 'symfony:hello', console: [PHP_BINARY, __FILE__])] // We need to force PHP binary to support windows +#[AsSymfonyTask(name: 'symfony:hello', console: [\PHP_BINARY, __FILE__])] // We need to force PHP binary to support windows class HelloCommand extends Command { protected function execute(InputInterface $input, OutputInterface $output): int @@ -27,7 +27,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } #[AsCommand('greet')] -#[AsSymfonyTask(name: 'symfony:greet', console: [PHP_BINARY, __FILE__])] // We need to force PHP binary to support windows +#[AsSymfonyTask(name: 'symfony:greet', console: [\PHP_BINARY, __FILE__])] // We need to force PHP binary to support windows class GreetCommand extends Command { protected function configure(): void diff --git a/tests/Examples/Generated/ArgPassthruExpanded.php b/tests/Examples/Generated/ArgPassthruExpanded.php index 05f989f2..6c82d9cf 100644 --- a/tests/Examples/Generated/ArgPassthruExpanded.php +++ b/tests/Examples/Generated/ArgPassthruExpanded.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ArgsAnotherArgsTest.php b/tests/Examples/Generated/ArgsAnotherArgsTest.php index bae04fdb..243f67a2 100644 --- a/tests/Examples/Generated/ArgsAnotherArgsTest.php +++ b/tests/Examples/Generated/ArgsAnotherArgsTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ArgsArgsTest.php b/tests/Examples/Generated/ArgsArgsTest.php index 9c14a65a..48438bb9 100644 --- a/tests/Examples/Generated/ArgsArgsTest.php +++ b/tests/Examples/Generated/ArgsArgsTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ArgsAutocompleteArgumentTest.php b/tests/Examples/Generated/ArgsAutocompleteArgumentTest.php index b2b600ee..99c78edd 100644 --- a/tests/Examples/Generated/ArgsAutocompleteArgumentTest.php +++ b/tests/Examples/Generated/ArgsAutocompleteArgumentTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ArgsPassthruTest.php b/tests/Examples/Generated/ArgsPassthruTest.php index 3f6b2d02..61dab182 100644 --- a/tests/Examples/Generated/ArgsPassthruTest.php +++ b/tests/Examples/Generated/ArgsPassthruTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/AutocompleteInvalidTest.php b/tests/Examples/Generated/AutocompleteInvalidTest.php index 2531c1e2..8aecf7ce 100644 --- a/tests/Examples/Generated/AutocompleteInvalidTest.php +++ b/tests/Examples/Generated/AutocompleteInvalidTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/BarBarTest.php b/tests/Examples/Generated/BarBarTest.php index 193873c2..4710d81e 100644 --- a/tests/Examples/Generated/BarBarTest.php +++ b/tests/Examples/Generated/BarBarTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/CacheComplexTest.php b/tests/Examples/Generated/CacheComplexTest.php index 9e053624..af4c84e3 100644 --- a/tests/Examples/Generated/CacheComplexTest.php +++ b/tests/Examples/Generated/CacheComplexTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/CacheSimpleTest.php b/tests/Examples/Generated/CacheSimpleTest.php index e25b9d37..c8860a89 100644 --- a/tests/Examples/Generated/CacheSimpleTest.php +++ b/tests/Examples/Generated/CacheSimpleTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/CdDirectoryTest.php b/tests/Examples/Generated/CdDirectoryTest.php index adcd1930..167ec515 100644 --- a/tests/Examples/Generated/CdDirectoryTest.php +++ b/tests/Examples/Generated/CdDirectoryTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextDoNotExistTest.php b/tests/Examples/Generated/ContextContextDoNotExistTest.php index fc453d44..abb00fcb 100644 --- a/tests/Examples/Generated/ContextContextDoNotExistTest.php +++ b/tests/Examples/Generated/ContextContextDoNotExistTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextDynamicTest.php b/tests/Examples/Generated/ContextContextDynamicTest.php index c144abcc..693dd76f 100644 --- a/tests/Examples/Generated/ContextContextDynamicTest.php +++ b/tests/Examples/Generated/ContextContextDynamicTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextInfoForcedTest.php b/tests/Examples/Generated/ContextContextInfoForcedTest.php index e3a963a9..9ae04421 100644 --- a/tests/Examples/Generated/ContextContextInfoForcedTest.php +++ b/tests/Examples/Generated/ContextContextInfoForcedTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextMyDefaultTest.php b/tests/Examples/Generated/ContextContextMyDefaultTest.php index 5a5be547..eb99cbd2 100644 --- a/tests/Examples/Generated/ContextContextMyDefaultTest.php +++ b/tests/Examples/Generated/ContextContextMyDefaultTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextPathTest.php b/tests/Examples/Generated/ContextContextPathTest.php index 21536ec6..ffeb72a9 100644 --- a/tests/Examples/Generated/ContextContextPathTest.php +++ b/tests/Examples/Generated/ContextContextPathTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextProductionTest.php b/tests/Examples/Generated/ContextContextProductionTest.php index e795e668..39ae1c33 100644 --- a/tests/Examples/Generated/ContextContextProductionTest.php +++ b/tests/Examples/Generated/ContextContextProductionTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextRunTest.php b/tests/Examples/Generated/ContextContextRunTest.php index 5cb7286b..5100ec00 100644 --- a/tests/Examples/Generated/ContextContextRunTest.php +++ b/tests/Examples/Generated/ContextContextRunTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextTest.php b/tests/Examples/Generated/ContextContextTest.php index 2cb5749a..7ec2e86b 100644 --- a/tests/Examples/Generated/ContextContextTest.php +++ b/tests/Examples/Generated/ContextContextTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextContextWithTest.php b/tests/Examples/Generated/ContextContextWithTest.php index 9deab6e1..f94a2973 100644 --- a/tests/Examples/Generated/ContextContextWithTest.php +++ b/tests/Examples/Generated/ContextContextWithTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextGeneratorArg2Test.php b/tests/Examples/Generated/ContextGeneratorArg2Test.php index bbf112be..22534e78 100644 --- a/tests/Examples/Generated/ContextGeneratorArg2Test.php +++ b/tests/Examples/Generated/ContextGeneratorArg2Test.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextGeneratorArgTest.php b/tests/Examples/Generated/ContextGeneratorArgTest.php index 965066a2..416dba4a 100644 --- a/tests/Examples/Generated/ContextGeneratorArgTest.php +++ b/tests/Examples/Generated/ContextGeneratorArgTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ContextGeneratorNotCallableTest.php b/tests/Examples/Generated/ContextGeneratorNotCallableTest.php index 22fc735c..c24b5ddb 100644 --- a/tests/Examples/Generated/ContextGeneratorNotCallableTest.php +++ b/tests/Examples/Generated/ContextGeneratorNotCallableTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/EnabledInProduction.php b/tests/Examples/Generated/EnabledInProduction.php index e26f6bb4..cd484b3a 100644 --- a/tests/Examples/Generated/EnabledInProduction.php +++ b/tests/Examples/Generated/EnabledInProduction.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/EnvEnvTest.php b/tests/Examples/Generated/EnvEnvTest.php index 4bbdf384..2a12a253 100644 --- a/tests/Examples/Generated/EnvEnvTest.php +++ b/tests/Examples/Generated/EnvEnvTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/EventListenerMyTaskTest.php b/tests/Examples/Generated/EventListenerMyTaskTest.php index e3db3435..2df5fc8a 100644 --- a/tests/Examples/Generated/EventListenerMyTaskTest.php +++ b/tests/Examples/Generated/EventListenerMyTaskTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/FailureAllowFailureTest.php b/tests/Examples/Generated/FailureAllowFailureTest.php index 0604db5c..85af7e3a 100644 --- a/tests/Examples/Generated/FailureAllowFailureTest.php +++ b/tests/Examples/Generated/FailureAllowFailureTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/FailureFailureTest.php b/tests/Examples/Generated/FailureFailureTest.php index 9527b4bd..0757bdc7 100644 --- a/tests/Examples/Generated/FailureFailureTest.php +++ b/tests/Examples/Generated/FailureFailureTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/FilesystemFilesystemTest.php b/tests/Examples/Generated/FilesystemFilesystemTest.php index f36727d8..66dbe830 100644 --- a/tests/Examples/Generated/FilesystemFilesystemTest.php +++ b/tests/Examples/Generated/FilesystemFilesystemTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/FilesystemFindTest.php b/tests/Examples/Generated/FilesystemFindTest.php index 9972dad4..af017e9e 100644 --- a/tests/Examples/Generated/FilesystemFindTest.php +++ b/tests/Examples/Generated/FilesystemFindTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/FooBarTest.php b/tests/Examples/Generated/FooBarTest.php index e15b30be..75669fa0 100644 --- a/tests/Examples/Generated/FooBarTest.php +++ b/tests/Examples/Generated/FooBarTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/FooFooTest.php b/tests/Examples/Generated/FooFooTest.php index 00610096..23218936 100644 --- a/tests/Examples/Generated/FooFooTest.php +++ b/tests/Examples/Generated/FooFooTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/HelloTest.php b/tests/Examples/Generated/HelloTest.php index 0905d4cb..47d8bd76 100644 --- a/tests/Examples/Generated/HelloTest.php +++ b/tests/Examples/Generated/HelloTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/HttpRequestTest.php b/tests/Examples/Generated/HttpRequestTest.php index 62cb77d1..439a8336 100644 --- a/tests/Examples/Generated/HttpRequestTest.php +++ b/tests/Examples/Generated/HttpRequestTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ImportComposerSourceTest.php b/tests/Examples/Generated/ImportComposerSourceTest.php index 86cc9e6d..3266d42e 100644 --- a/tests/Examples/Generated/ImportComposerSourceTest.php +++ b/tests/Examples/Generated/ImportComposerSourceTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ImportFileNotExistTest.php b/tests/Examples/Generated/ImportFileNotExistTest.php index 20252b38..44a8dcaa 100644 --- a/tests/Examples/Generated/ImportFileNotExistTest.php +++ b/tests/Examples/Generated/ImportFileNotExistTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ImportInvalidFormatTest.php b/tests/Examples/Generated/ImportInvalidFormatTest.php index f5365499..bb3079da 100644 --- a/tests/Examples/Generated/ImportInvalidFormatTest.php +++ b/tests/Examples/Generated/ImportInvalidFormatTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ImportInvalidImportTest.php b/tests/Examples/Generated/ImportInvalidImportTest.php index ac35bb25..6ed9589e 100644 --- a/tests/Examples/Generated/ImportInvalidImportTest.php +++ b/tests/Examples/Generated/ImportInvalidImportTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ImportInvalidPackageTest.php b/tests/Examples/Generated/ImportInvalidPackageTest.php index 157427a0..22e87f97 100644 --- a/tests/Examples/Generated/ImportInvalidPackageTest.php +++ b/tests/Examples/Generated/ImportInvalidPackageTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ImportSamePackageDifferentVersionTest.php b/tests/Examples/Generated/ImportSamePackageDifferentVersionTest.php index 44f27478..d1546256 100644 --- a/tests/Examples/Generated/ImportSamePackageDifferentVersionTest.php +++ b/tests/Examples/Generated/ImportSamePackageDifferentVersionTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/LayoutWithFolder.php b/tests/Examples/Generated/LayoutWithFolder.php index 3456d7bb..c507b094 100644 --- a/tests/Examples/Generated/LayoutWithFolder.php +++ b/tests/Examples/Generated/LayoutWithFolder.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/LayoutWithOldFolder.php b/tests/Examples/Generated/LayoutWithOldFolder.php index f29ae2ba..e71c4b62 100644 --- a/tests/Examples/Generated/LayoutWithOldFolder.php +++ b/tests/Examples/Generated/LayoutWithOldFolder.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ListTest.php b/tests/Examples/Generated/ListTest.php index 637797af..2ce94c33 100644 --- a/tests/Examples/Generated/ListTest.php +++ b/tests/Examples/Generated/ListTest.php @@ -17,10 +17,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NewProjectInitTest.php b/tests/Examples/Generated/NewProjectInitTest.php index 8e861631..cf244aaa 100644 --- a/tests/Examples/Generated/NewProjectInitTest.php +++ b/tests/Examples/Generated/NewProjectInitTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NewProjectTest.php b/tests/Examples/Generated/NewProjectTest.php index 11474bc9..37d3d666 100644 --- a/tests/Examples/Generated/NewProjectTest.php +++ b/tests/Examples/Generated/NewProjectTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NoConfigCompletionTest.php b/tests/Examples/Generated/NoConfigCompletionTest.php index 3fa316e5..fdebcf94 100644 --- a/tests/Examples/Generated/NoConfigCompletionTest.php +++ b/tests/Examples/Generated/NoConfigCompletionTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NoConfigUnknownTest.php b/tests/Examples/Generated/NoConfigUnknownTest.php index 589ecc84..a895916a 100644 --- a/tests/Examples/Generated/NoConfigUnknownTest.php +++ b/tests/Examples/Generated/NoConfigUnknownTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NoConfigUnknownWithArgsTest.php b/tests/Examples/Generated/NoConfigUnknownWithArgsTest.php index 18813946..7a64bf6c 100644 --- a/tests/Examples/Generated/NoConfigUnknownWithArgsTest.php +++ b/tests/Examples/Generated/NoConfigUnknownWithArgsTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NoDefaultContextTest.php b/tests/Examples/Generated/NoDefaultContextTest.php index 83bd4059..266d3f58 100644 --- a/tests/Examples/Generated/NoDefaultContextTest.php +++ b/tests/Examples/Generated/NoDefaultContextTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NoNamespaceTest.php b/tests/Examples/Generated/NoNamespaceTest.php index f438bb6e..6571c530 100644 --- a/tests/Examples/Generated/NoNamespaceTest.php +++ b/tests/Examples/Generated/NoNamespaceTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NotRenameRenamedTest.php b/tests/Examples/Generated/NotRenameRenamedTest.php index 4ac92e3b..471ac364 100644 --- a/tests/Examples/Generated/NotRenameRenamedTest.php +++ b/tests/Examples/Generated/NotRenameRenamedTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NotifyNotifyOnFinishTest.php b/tests/Examples/Generated/NotifyNotifyOnFinishTest.php index 1b8014ce..686d37a8 100644 --- a/tests/Examples/Generated/NotifyNotifyOnFinishTest.php +++ b/tests/Examples/Generated/NotifyNotifyOnFinishTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/NotifySendNotifyTest.php b/tests/Examples/Generated/NotifySendNotifyTest.php index c0413c81..3e147126 100644 --- a/tests/Examples/Generated/NotifySendNotifyTest.php +++ b/tests/Examples/Generated/NotifySendNotifyTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/OutputOutputTest.php b/tests/Examples/Generated/OutputOutputTest.php index 002ed16b..5e8413c3 100644 --- a/tests/Examples/Generated/OutputOutputTest.php +++ b/tests/Examples/Generated/OutputOutputTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ParallelExceptionTest.php b/tests/Examples/Generated/ParallelExceptionTest.php index 62324cd2..e51e405d 100644 --- a/tests/Examples/Generated/ParallelExceptionTest.php +++ b/tests/Examples/Generated/ParallelExceptionTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ParallelSleepTest.php b/tests/Examples/Generated/ParallelSleepTest.php index b8f935f5..2655843a 100644 --- a/tests/Examples/Generated/ParallelSleepTest.php +++ b/tests/Examples/Generated/ParallelSleepTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/QuietQuietTest.php b/tests/Examples/Generated/QuietQuietTest.php index 68755fbc..b4201b0b 100644 --- a/tests/Examples/Generated/QuietQuietTest.php +++ b/tests/Examples/Generated/QuietQuietTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/RunTestFileTest.php b/tests/Examples/Generated/RunTestFileTest.php index 4411daa0..253b9ffd 100644 --- a/tests/Examples/Generated/RunTestFileTest.php +++ b/tests/Examples/Generated/RunTestFileTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/RunVariablesTest.php b/tests/Examples/Generated/RunVariablesTest.php index 3e8ecb16..3ef921c2 100644 --- a/tests/Examples/Generated/RunVariablesTest.php +++ b/tests/Examples/Generated/RunVariablesTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/RunWhoamiTest.php b/tests/Examples/Generated/RunWhoamiTest.php index ee5674d1..f6d69ebb 100644 --- a/tests/Examples/Generated/RunWhoamiTest.php +++ b/tests/Examples/Generated/RunWhoamiTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/RunWithProcessHelperTest.php b/tests/Examples/Generated/RunWithProcessHelperTest.php index 5824c203..7f1c54e0 100644 --- a/tests/Examples/Generated/RunWithProcessHelperTest.php +++ b/tests/Examples/Generated/RunWithProcessHelperTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ShellBashTest.php b/tests/Examples/Generated/ShellBashTest.php index d65e7af2..8ca0ff97 100644 --- a/tests/Examples/Generated/ShellBashTest.php +++ b/tests/Examples/Generated/ShellBashTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/ShellShTest.php b/tests/Examples/Generated/ShellShTest.php index 877d9394..4c1b2089 100644 --- a/tests/Examples/Generated/ShellShTest.php +++ b/tests/Examples/Generated/ShellShTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/SignalSigusr2Test.php b/tests/Examples/Generated/SignalSigusr2Test.php index 59fcd5d6..bac195a6 100644 --- a/tests/Examples/Generated/SignalSigusr2Test.php +++ b/tests/Examples/Generated/SignalSigusr2Test.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/SymfonyGreetTest.php b/tests/Examples/Generated/SymfonyGreetTest.php index 80c247c5..ead5c628 100644 --- a/tests/Examples/Generated/SymfonyGreetTest.php +++ b/tests/Examples/Generated/SymfonyGreetTest.php @@ -17,10 +17,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/SymfonyHelloTest.php b/tests/Examples/Generated/SymfonyHelloTest.php index 81a2d60a..5e187510 100644 --- a/tests/Examples/Generated/SymfonyHelloTest.php +++ b/tests/Examples/Generated/SymfonyHelloTest.php @@ -17,10 +17,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/TwoDefaultContextTest.php b/tests/Examples/Generated/TwoDefaultContextTest.php index 8a0128e7..ca84a2a2 100644 --- a/tests/Examples/Generated/TwoDefaultContextTest.php +++ b/tests/Examples/Generated/TwoDefaultContextTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php b/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php index 1ad88d14..989b464a 100644 --- a/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php +++ b/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(1, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/VersionGuardMinVersionCheckTest.php b/tests/Examples/Generated/VersionGuardMinVersionCheckTest.php index d136d870..38fa323f 100644 --- a/tests/Examples/Generated/VersionGuardMinVersionCheckTest.php +++ b/tests/Examples/Generated/VersionGuardMinVersionCheckTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/WaitForCustomWaitForTaskTest.php b/tests/Examples/Generated/WaitForCustomWaitForTaskTest.php index 8025ab34..84568e6c 100644 --- a/tests/Examples/Generated/WaitForCustomWaitForTaskTest.php +++ b/tests/Examples/Generated/WaitForCustomWaitForTaskTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/WaitForWaitForDockerContainerTaskTest.php b/tests/Examples/Generated/WaitForWaitForDockerContainerTaskTest.php index 439b73b3..e2e555be 100644 --- a/tests/Examples/Generated/WaitForWaitForDockerContainerTaskTest.php +++ b/tests/Examples/Generated/WaitForWaitForDockerContainerTaskTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/WaitForWaitForPortTaskTest.php b/tests/Examples/Generated/WaitForWaitForPortTaskTest.php index 005a1fa0..0e39c089 100644 --- a/tests/Examples/Generated/WaitForWaitForPortTaskTest.php +++ b/tests/Examples/Generated/WaitForWaitForPortTaskTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/WaitForWaitForUrlTaskTest.php b/tests/Examples/Generated/WaitForWaitForUrlTaskTest.php index f58413f7..b0c7638b 100644 --- a/tests/Examples/Generated/WaitForWaitForUrlTaskTest.php +++ b/tests/Examples/Generated/WaitForWaitForUrlTaskTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/WaitForWaitForUrlWithSpecificResponseContentAndStatusTest.php b/tests/Examples/Generated/WaitForWaitForUrlWithSpecificResponseContentAndStatusTest.php index e42078ce..7c198e3a 100644 --- a/tests/Examples/Generated/WaitForWaitForUrlWithSpecificResponseContentAndStatusTest.php +++ b/tests/Examples/Generated/WaitForWaitForUrlWithSpecificResponseContentAndStatusTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/WaitForWaitForUrlWithStatusCodeOnlyTest.php b/tests/Examples/Generated/WaitForWaitForUrlWithStatusCodeOnlyTest.php index 32c9adb8..9b60fb21 100644 --- a/tests/Examples/Generated/WaitForWaitForUrlWithStatusCodeOnlyTest.php +++ b/tests/Examples/Generated/WaitForWaitForUrlWithStatusCodeOnlyTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/YamlDumpTest.php b/tests/Examples/Generated/YamlDumpTest.php index ac346164..1f30ba72 100644 --- a/tests/Examples/Generated/YamlDumpTest.php +++ b/tests/Examples/Generated/YamlDumpTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/Generated/YamlParseTest.php b/tests/Examples/Generated/YamlParseTest.php index 29ffadf9..9bbf7d7b 100644 --- a/tests/Examples/Generated/YamlParseTest.php +++ b/tests/Examples/Generated/YamlParseTest.php @@ -13,10 +13,6 @@ public function test(): void $this->assertSame(0, $process->getExitCode()); $this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); - if (file_exists(__FILE__ . '.err.txt')) { - $this->assertStringEqualsFile(__FILE__ . '.err.txt', $process->getErrorOutput()); - } else { - $this->assertSame('', $process->getErrorOutput()); - } + $this->assertSame('', $process->getErrorOutput()); } } diff --git a/tests/Examples/ListOnStaticBinTest.php b/tests/Examples/ListOnStaticBinTest.php index 777ec64d..4a2d433e 100644 --- a/tests/Examples/ListOnStaticBinTest.php +++ b/tests/Examples/ListOnStaticBinTest.php @@ -11,7 +11,7 @@ class ListOnStaticBinTest extends TaskTestCase public function test(): void { if (!self::$binary) { - $this->markTestSkipped('This test for the binary version of Castor.'); + $this->markTestSkipped('This test is for the binary version of Castor.'); } $process = $this->runTask(['list', '--raw', '--format', 'txt', '--short']); diff --git a/tests/TaskTestCase.php b/tests/TaskTestCase.php index 8d96f684..290f9763 100644 --- a/tests/TaskTestCase.php +++ b/tests/TaskTestCase.php @@ -9,8 +9,8 @@ abstract class TaskTestCase extends TestCase { - static string $castorBin; - static bool $binary = false; + public static string $castorBin; + public static bool $binary = false; public static function setUpBeforeClass(): void {