Skip to content

Commit

Permalink
Fix: Slide statements
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed May 2, 2023
1 parent ab21281 commit f8471e7
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -71,6 +69,7 @@ public function testSucceeds(
);

self::assertStringContainsString($expected, $display);
self::assertExitCodeSame(0, $exitCode);

$currentState = $scenario->currentState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -96,8 +95,6 @@ public function testSucceedsWhenDiffOptionIsUsed(Util\CommandInvocation $command
$output,
);

self::assertExitCodeSame(0, $exitCode);

$expected = \sprintf(
'Successfully normalized %s.',
$scenario->composerJsonFileReference(),
Expand All @@ -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();

Expand Down Expand Up @@ -145,8 +143,6 @@ public function testFailsDryRunOptionIsUsed(Util\CommandInvocation $commandInvoc
$output,
);

self::assertExitCodeSame(1, $exitCode);

$renderedOutput = $output->fetch();

$expected = \sprintf(
Expand All @@ -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());
}

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -66,6 +64,7 @@ public function testSucceeds(Util\CommandInvocation $commandInvocation): void
);

self::assertStringContainsString($expected, $display);
self::assertExitCodeSame(0, $exitCode);

$currentState = $scenario->currentState();

Expand Down Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -97,8 +96,6 @@ public function testFailsWhenDryRunOptionIsUsed(Util\CommandInvocation $commandI
$output,
);

self::assertExitCodeSame(1, $exitCode);

$renderedOutput = $output->fetch();

$expected = \sprintf(
Expand All @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand All @@ -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());
}

Expand Down Expand Up @@ -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());
}

Expand Down Expand Up @@ -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());
}
}

0 comments on commit f8471e7

Please sign in to comment.