Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use assertStringContainsString() instead of assertContains() #247

Merged
merged 1 commit into from
Dec 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions test/Integration/Command/NormalizeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testFailsWhenIndentStyleIsUsedWithoutIndentSize(CommandInvocatio
);

self::assertExitCodeSame(1, $exitCode);
self::assertContains('When using the indent-style option, an indent size needs to be specified using the indent-size option.', $output->fetch());
self::assertStringContainsString('When using the indent-style option, an indent size needs to be specified using the indent-size option.', $output->fetch());
self::assertEquals($scenario->initialState(), $scenario->currentState());
}

Expand Down Expand Up @@ -126,7 +126,7 @@ public function testFailsWhenIndentSizeIsUsedWithoutIndentStyle(CommandInvocatio
);

self::assertExitCodeSame(1, $exitCode);
self::assertContains('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::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::assertEquals($scenario->initialState(), $scenario->currentState());
}

Expand Down Expand Up @@ -167,7 +167,7 @@ public function testFailsWhenIndentStyleIsInvalid(CommandInvocation $commandInvo
$indentStyle
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());
self::assertEquals($scenario->initialState(), $scenario->currentState());
}

Expand Down Expand Up @@ -210,7 +210,7 @@ public function testFailsWhenIndentSizeIsInvalid(CommandInvocation $commandInvoc
$indentSize
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());
self::assertEquals($scenario->initialState(), $scenario->currentState());
}

Expand Down Expand Up @@ -297,7 +297,7 @@ public function normalize(Json $json): Json
);

self::assertExitCodeSame(1, $exitCode);
self::assertContains($exceptionMessage, $output->fetch());
self::assertStringContainsString($exceptionMessage, $output->fetch());
self::assertEquals($initialState, $scenario->currentState());
}

Expand Down Expand Up @@ -336,7 +336,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());
self::assertEquals($initialState, $scenario->currentState());
}

Expand Down Expand Up @@ -375,7 +375,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());

$currentState = $scenario->currentState();

Expand Down Expand Up @@ -422,11 +422,11 @@ public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsNotPr
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $renderedOutput);
self::assertContains('--- original', $renderedOutput);
self::assertContains('+++ normalized', $renderedOutput);
self::assertContains('---------- begin diff ----------', $renderedOutput);
self::assertContains('----------- end diff -----------', $renderedOutput);
self::assertStringContainsString($expected, $renderedOutput);
self::assertStringContainsString('--- original', $renderedOutput);
self::assertStringContainsString('+++ normalized', $renderedOutput);
self::assertStringContainsString('---------- begin diff ----------', $renderedOutput);
self::assertStringContainsString('----------- end diff -----------', $renderedOutput);
self::assertEquals($initialState, $scenario->currentState());
}

Expand Down Expand Up @@ -473,7 +473,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());

$currentState = $scenario->currentState();

Expand Down Expand Up @@ -518,7 +518,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsNo
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());

$currentState = $scenario->currentState();

Expand Down Expand Up @@ -556,7 +556,7 @@ public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsPrese
);

self::assertExitCodeSame(1, $exitCode);
self::assertContains('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::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::assertEquals($initialState, $scenario->currentState());
}

Expand Down Expand Up @@ -596,7 +596,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPr
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());
self::assertEquals($initialState, $scenario->currentState());
}

Expand Down Expand Up @@ -636,7 +636,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPr
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());

$currentState = $scenario->currentState();

Expand Down Expand Up @@ -680,7 +680,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPr
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());

$currentState = $scenario->currentState();

Expand Down Expand Up @@ -728,9 +728,9 @@ public function testFailsWhenComposerJsonIsPresentAndValidAndComposerLockIsPrese
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $renderedOutput);
self::assertContains('---------- begin diff ----------', $renderedOutput);
self::assertContains('----------- end diff -----------', $renderedOutput);
self::assertStringContainsString($expected, $renderedOutput);
self::assertStringContainsString('---------- begin diff ----------', $renderedOutput);
self::assertStringContainsString('----------- end diff -----------', $renderedOutput);
self::assertEquals($initialState, $scenario->currentState());
}

Expand Down Expand Up @@ -772,7 +772,7 @@ public function testSucceedsWhenComposerJsonIsPresentAndValidAndComposerLockIsPr
$scenario->composerJsonFileReference()
);

self::assertContains($expected, $output->fetch());
self::assertStringContainsString($expected, $output->fetch());

$currentState = $scenario->currentState();

Expand Down