PHPUnit's assertContains() performs strict comparisons now.

This commit is contained in:
Alexander M. Turek 2020-08-09 14:16:18 +02:00
parent 33e7130d65
commit 9f4dec59a4
3 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ class RequestDataCollectorTest extends TestCase
$this->assertEquals(['name' => 'foo'], $c->getRouteParams()); $this->assertEquals(['name' => 'foo'], $c->getRouteParams());
$this->assertSame([], $c->getSessionAttributes()); $this->assertSame([], $c->getSessionAttributes());
$this->assertSame('en', $c->getLocale()); $this->assertSame('en', $c->getLocale());
$this->assertContains(__FILE__, $attributes->get('resource')); $this->assertContainsEquals(__FILE__, $attributes->get('resource'));
$this->assertSame('stdClass', $attributes->get('object')->getType()); $this->assertSame('stdClass', $attributes->get('object')->getType());
$this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getResponseHeaders()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getResponseHeaders());

View File

@ -293,8 +293,8 @@ class FileProfilerStorageTest extends TestCase
$tokens = $this->storage->find('', '', 10, ''); $tokens = $this->storage->find('', '', 10, '');
$this->assertCount(2, $tokens); $this->assertCount(2, $tokens);
$this->assertContains($tokens[0]['status_code'], [200, 404]); $this->assertContains((int) $tokens[0]['status_code'], [200, 404]);
$this->assertContains($tokens[1]['status_code'], [200, 404]); $this->assertContains((int) $tokens[1]['status_code'], [200, 404]);
} }
public function testMultiRowIndexFile() public function testMultiRowIndexFile()

View File

@ -319,12 +319,12 @@ class TranslatorTest extends TestCase
$resources = $translator->getCatalogue('en')->getResources(); $resources = $translator->getCatalogue('en')->getResources();
$this->assertCount(1, $resources); $this->assertCount(1, $resources);
$this->assertContains(__DIR__.\DIRECTORY_SEPARATOR.'fixtures'.\DIRECTORY_SEPARATOR.'resources.yml', $resources); $this->assertContainsEquals(__DIR__.\DIRECTORY_SEPARATOR.'fixtures'.\DIRECTORY_SEPARATOR.'resources.yml', $resources);
$resources = $translator->getCatalogue('en_GB')->getResources(); $resources = $translator->getCatalogue('en_GB')->getResources();
$this->assertCount(2, $resources); $this->assertCount(2, $resources);
$this->assertContains(__DIR__.\DIRECTORY_SEPARATOR.'fixtures'.\DIRECTORY_SEPARATOR.'empty.yml', $resources); $this->assertContainsEquals(__DIR__.\DIRECTORY_SEPARATOR.'fixtures'.\DIRECTORY_SEPARATOR.'empty.yml', $resources);
$this->assertContains(__DIR__.\DIRECTORY_SEPARATOR.'fixtures'.\DIRECTORY_SEPARATOR.'resources.yml', $resources); $this->assertContainsEquals(__DIR__.\DIRECTORY_SEPARATOR.'fixtures'.\DIRECTORY_SEPARATOR.'resources.yml', $resources);
} }
/** /**