From f8471e782f18cf576d2f1243f904e9213bb50c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 2 May 2023 14:08:19 +0200 Subject: [PATCH] Fix: Slide statements --- .../Extra/IsValid/No/IndentSize/Missing/Test.php | 2 +- .../No/IndentSize/NotGreaterThanZero/Test.php | 2 +- .../IsValid/No/IndentSize/NotInteger/Test.php | 2 +- .../Extra/IsValid/No/IndentStyle/Missing/Test.php | 2 +- .../IsValid/No/IndentStyle/NotSpaceOrTab/Test.php | 2 +- .../IsValid/No/IndentStyle/NotString/Test.php | 2 +- .../Extra/IsValid/Yes/UsingOptions/No/Test.php | 3 +-- .../Extra/IsValid/Yes/UsingOptions/Yes/Test.php | 3 +-- .../NormalizeCommand/Json/IsValid/No/Test.php | 2 +- .../IsPresent/No/Json/IsNormalized/No/Test.php | 15 +++++---------- .../IsPresent/No/Json/IsNormalized/Yes/Test.php | 3 +-- .../No/UsingNoCheckLockOption/No/Test.php | 2 +- .../Yes/Json/IsNormalized/No/Test.php | 3 +-- .../Yes/Json/IsNormalized/Yes/Test.php | 3 +-- .../IsNormalized/No/Lock/IsFreshAfter/No/Test.php | 6 ++---- .../No/Lock/IsFreshAfter/Yes/Test.php | 6 ++---- .../Yes/Json/IsNormalized/Yes/Test.php | 3 +-- .../NormalizeCommand/Normalizer/Throws/Test.php | 2 +- .../NormalizeCommand/Options/AreValid/No/Test.php | 10 ++++------ 19 files changed, 28 insertions(+), 45 deletions(-) diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/Missing/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/Missing/Test.php index 65248a0a..8153c0a7 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/Missing/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/Missing/Test.php @@ -48,8 +48,8 @@ public function testFails(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('Configuration in composer extra requires keys "indent-size", "indent-style" with corresponding values.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotGreaterThanZero/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotGreaterThanZero/Test.php index e2a6cfcd..f9b64576 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotGreaterThanZero/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotGreaterThanZero/Test.php @@ -48,8 +48,8 @@ public function testFails(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('Indent size needs to be an integer greater than 0, but 0 is not.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotInteger/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotInteger/Test.php index 3bcc7b18..5844d139 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotInteger/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentSize/NotInteger/Test.php @@ -48,8 +48,8 @@ public function testFails(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('Indent size needs to be an integer, got array instead.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/Missing/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/Missing/Test.php index c85ea09d..b4ba346d 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/Missing/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/Missing/Test.php @@ -48,8 +48,8 @@ public function testFails(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('Configuration in composer extra requires keys "indent-size", "indent-style" with corresponding values.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotSpaceOrTab/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotSpaceOrTab/Test.php index 554512ba..bb40f3ac 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotSpaceOrTab/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotSpaceOrTab/Test.php @@ -48,8 +48,8 @@ public function testFails(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('Indent style needs to be one of "space", "tab", but "foo" is not.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotString/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotString/Test.php index c8e326eb..3f84b0ff 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotString/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/No/IndentStyle/NotString/Test.php @@ -48,8 +48,8 @@ public function testFails(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('Indent style needs to be a string, got array instead.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/No/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/No/Test.php index 90380ac1..ed04650b 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/No/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/No/Test.php @@ -53,14 +53,13 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); diff --git a/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/Yes/Test.php b/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/Yes/Test.php index ff6b5078..c8f58a04 100644 --- a/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/Yes/Test.php +++ b/test/Integration/Command/NormalizeCommand/Extra/IsValid/Yes/UsingOptions/Yes/Test.php @@ -59,8 +59,6 @@ public function testSucceeds( $output, ); - self::assertExitCodeSame(0, $exitCode); - $display = $output->fetch(); self::assertStringContainsString('Configuration provided via options and composer extra. Using configuration from composer extra.', $display); @@ -71,6 +69,7 @@ public function testSucceeds( ); self::assertStringContainsString($expected, $display); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/No/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/No/Test.php index d974bb45..dbbc9ee4 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/No/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/No/Test.php @@ -53,8 +53,8 @@ public function testFailsWhenComposerJsonIsValidAccordingToLaxValidation(Util\Co $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('does not match the expected JSON schema', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/No/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/No/Test.php index 8c6e5289..d45f8a8c 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/No/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/No/Test.php @@ -53,14 +53,13 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); @@ -96,8 +95,6 @@ public function testSucceedsWhenDiffOptionIsUsed(Util\CommandInvocation $command $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), @@ -110,6 +107,7 @@ public function testSucceedsWhenDiffOptionIsUsed(Util\CommandInvocation $command self::assertStringContainsString('+++ normalized', $renderedOutput); self::assertStringContainsString('---------- begin diff ----------', $renderedOutput); self::assertStringContainsString('----------- end diff -----------', $renderedOutput); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); @@ -145,8 +143,6 @@ public function testFailsDryRunOptionIsUsed(Util\CommandInvocation $commandInvoc $output, ); - self::assertExitCodeSame(1, $exitCode); - $renderedOutput = $output->fetch(); $expected = \sprintf( @@ -159,6 +155,7 @@ public function testFailsDryRunOptionIsUsed(Util\CommandInvocation $commandInvoc self::assertStringContainsString('+++ normalized', $renderedOutput); self::assertStringContainsString('---------- begin diff ----------', $renderedOutput); self::assertStringContainsString('----------- end diff -----------', $renderedOutput); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } @@ -194,14 +191,13 @@ public function testSucceedsWhenIndentSizeAndIndentStyleOptionsAreUsed( $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); @@ -237,14 +233,13 @@ public function testSucceedsNoUpdateLockOptionIsUsed(Util\CommandInvocation $com $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/Yes/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/Yes/Test.php index 0b479eed..c3cc6767 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/Yes/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/No/Json/IsNormalized/Yes/Test.php @@ -53,14 +53,13 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( '%s is already normalized.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/No/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/No/Test.php index 042e9f14..66c3f8c2 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/No/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/No/Test.php @@ -54,8 +54,8 @@ public function testFailsWhenComposerJsonIsPresentAndValidAccordingToLaxValidati $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update --lock`.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/No/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/No/Test.php index 4abbad08..7faae03c 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/No/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/No/Test.php @@ -56,14 +56,13 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/Yes/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/Yes/Test.php index 83c981d1..aaf6b0f9 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/Yes/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/No/UsingNoCheckLockOption/Yes/Json/IsNormalized/Yes/Test.php @@ -56,14 +56,13 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( '%s is already normalized.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/No/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/No/Test.php index d5584785..7a182f02 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/No/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/No/Test.php @@ -54,8 +54,6 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $display = $output->fetch(); self::assertStringNotContainsString('A script named hello would override a Composer command and has been skipped', $display); @@ -66,6 +64,7 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void ); self::assertStringContainsString($expected, $display); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); @@ -103,14 +102,13 @@ public function testSucceedsWhenNoUpdateLockOptionIsUsed(Util\CommandInvocation $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/Yes/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/Yes/Test.php index 7773a385..1cd76ce9 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/Yes/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/No/Lock/IsFreshAfter/Yes/Test.php @@ -54,14 +54,13 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( 'Successfully normalized %s.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); $currentState = $scenario->currentState(); @@ -97,8 +96,6 @@ public function testFailsWhenDryRunOptionIsUsed(Util\CommandInvocation $commandI $output, ); - self::assertExitCodeSame(1, $exitCode); - $renderedOutput = $output->fetch(); $expected = \sprintf( @@ -109,6 +106,7 @@ public function testFailsWhenDryRunOptionIsUsed(Util\CommandInvocation $commandI self::assertStringContainsString($expected, $renderedOutput); self::assertStringContainsString('---------- begin diff ----------', $renderedOutput); self::assertStringContainsString('----------- end diff -----------', $renderedOutput); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/Yes/Test.php b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/Yes/Test.php index 132fd94f..55937c45 100644 --- a/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/Yes/Test.php +++ b/test/Integration/Command/NormalizeCommand/Json/IsValid/Yes/Lock/IsPresent/Yes/IsFreshBefore/Yes/Json/IsNormalized/Yes/Test.php @@ -54,14 +54,13 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void $output, ); - self::assertExitCodeSame(0, $exitCode); - $expected = \sprintf( '%s is already normalized.', $scenario->composerJsonFileReference(), ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(0, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Normalizer/Throws/Test.php b/test/Integration/Command/NormalizeCommand/Normalizer/Throws/Test.php index de01e114..27c6d668 100644 --- a/test/Integration/Command/NormalizeCommand/Normalizer/Throws/Test.php +++ b/test/Integration/Command/NormalizeCommand/Normalizer/Throws/Test.php @@ -78,8 +78,8 @@ public function normalize(Json $json): Json $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString($exceptionMessage, $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($initialState, $scenario->currentState()); } } diff --git a/test/Integration/Command/NormalizeCommand/Options/AreValid/No/Test.php b/test/Integration/Command/NormalizeCommand/Options/AreValid/No/Test.php index f44f68e3..27f4e225 100644 --- a/test/Integration/Command/NormalizeCommand/Options/AreValid/No/Test.php +++ b/test/Integration/Command/NormalizeCommand/Options/AreValid/No/Test.php @@ -54,8 +54,8 @@ public function testFailsWhenIndentStyleOptionIsUsedWithoutIndentSizeOption(Util $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('When using the indent-style option, an indent size needs to be specified using the indent-size option.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } @@ -82,8 +82,8 @@ public function testFailsWhenIndentSizeOptionIsUsedWithoutIndentStyleOption(Util $output, ); - self::assertExitCodeSame(1, $exitCode); self::assertStringContainsString('When using the indent-size option, an indent style (one of "space", "tab") needs to be specified using the indent-style option.', $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } @@ -115,14 +115,13 @@ public function testFailsWhenIndentStyleOptionIsInvalid(Util\CommandInvocation $ $output, ); - self::assertExitCodeSame(1, $exitCode); - $expected = \sprintf( 'Indent style needs to be one of "space", "tab", but "%s" is not.', $indentStyle, ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } @@ -155,14 +154,13 @@ public function testFailsWhenIndentSizeOptionIsInvalid( $output, ); - self::assertExitCodeSame(1, $exitCode); - $expected = \sprintf( 'Indent size needs to be an integer greater than 0, but "%s" is not.', $indentSize, ); self::assertStringContainsString($expected, $output->fetch()); + self::assertExitCodeSame(1, $exitCode); self::assertEquals($scenario->initialState(), $scenario->currentState()); } }