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

[Testing] Change deprecated assertContains to assertStringContainsString #13511

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ console::

// the output of the command in the console
$output = $commandTester->getDisplay();
$this->assertContains('Username: Wouter', $output);
$this->assertStringContainsString('Username: Wouter', $output);

// ...
}
Expand Down
4 changes: 2 additions & 2 deletions create_framework/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ resolver. Modify the framework to make use of them::
namespace Simplex;

// ...

use Calendar\Controller\LeapYearController;
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
Expand Down Expand Up @@ -183,7 +183,7 @@ Response::
$response = $framework->handle(new Request());

$this->assertEquals(200, $response->getStatusCode());
$this->assertContains('Yep, this is a leap year!', $response->getContent());
$this->assertStringContainsString('Yep, this is a leap year!', $response->getContent());
}

In this test, we simulate a route that matches and returns a simple
Expand Down
4 changes: 2 additions & 2 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Or test against the response content directly if you just want to assert that
the content contains some text or in case that the response is not an XML/HTML
document::

$this->assertContains(
$this->assertStringContainsString(
'Hello World',
$client->getResponse()->getContent()
);
Expand Down Expand Up @@ -316,7 +316,7 @@ document::
);

// asserts that the response content contains a string
$this->assertContains('foo', $client->getResponse()->getContent());
$this->assertStringContainsString('foo', $client->getResponse()->getContent());
// ...or matches a regex
$this->assertRegExp('/foo(bar)?/', $client->getResponse()->getContent());

Expand Down