Error:
PHPUnit 6.0.7 by Sebastian Bergmann and contributors.
mb_strpos(): Empty delimiter
.../vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php:58 // this line added manualy because error handler catch this and after run debug mode then show line number and correct class
.../vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:73
.../tests/AppBundle/Controller/LoginControllerTest.php:25
Time: 108 ms, Memory: 14.00MB
ERRORS!
Tests: 1, Assertions: 2, Errors: 1.
Process finished with exit code 2
My example test:
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
static::assertEquals(200, $client->getResponse()->getStatusCode());
static::assertContains('', $crawler->filter('body')->text());
}
I think assertContains should return true if expected (needle) value is the same as (haystack) or if some one check if empty string contains another empty string.
Visualized problem:
static::assertContains('', '');
or if someone would like to use assertContains for comparing two empty strings, maybe library inform that is not good way - I don't now. Like "assertContains is not for comparing to empty strings!... Please use assertEquals"? - I don't now. I'm not a specialist in XUnit philosophy. Now I fix this by change my testcase. But it is temporary solution.
Error:
My example test:
I think assertContains should return true if expected (needle) value is the same as (haystack) or if some one check if empty string contains another empty string.
Visualized problem:
or if someone would like to use assertContains for comparing two empty strings, maybe library inform that is not good way - I don't now. Like "assertContains is not for comparing to empty strings!... Please use assertEquals"? - I don't now. I'm not a specialist in XUnit philosophy. Now I fix this by change my testcase. But it is temporary solution.