Skip to content

Commit 2f4019b

Browse files
committed
Merge branch '5.0'
* 5.0: [Testing] Change deprecated assertContains to assertStringContainsString
2 parents 1b6f20d + 0147fe6 commit 2f4019b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

console.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ console::
370370

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

375375
// ...
376376
}

create_framework/unit_testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ resolver. Modify the framework to make use of them::
4949
namespace Simplex;
5050

5151
// ...
52-
52+
5353
use Calendar\Controller\LeapYearController;
5454
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
5555
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
@@ -183,7 +183,7 @@ Response::
183183
$response = $framework->handle(new Request());
184184

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

189189
In this test, we simulate a route that matches and returns a simple

testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Or test against the response content directly if you just want to assert that
270270
the content contains some text or in case that the response is not an XML/HTML
271271
document::
272272

273-
$this->assertContains(
273+
$this->assertStringContainsString(
274274
'Hello World',
275275
$client->getResponse()->getContent()
276276
);
@@ -316,7 +316,7 @@ document::
316316
);
317317

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

0 commit comments

Comments
 (0)