Skip to content

Commit b87779a

Browse files
author
tcoch
committed
Fix for specific test PHP 8.1 + SF6.4.* lowest deps
1 parent 5e4509a commit b87779a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/Util/YamlSourceManipulatorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Psr\Log\LogLevel;
1717
use Symfony\Bundle\MakerBundle\Util\YamlSourceManipulator;
1818
use Symfony\Component\Finder\Finder;
19+
use Symfony\Component\HttpKernel\Kernel;
1920
use Symfony\Component\HttpKernel\Log\Logger;
2021
use Symfony\Component\Yaml\Yaml;
2122

@@ -48,7 +49,11 @@ public function testSetData(string $startingSource, array $newData, string $expe
4849
*/
4950
$actualContents = $manipulator->getContents();
5051
$actualContents = str_replace("\r\n", "\n", $actualContents);
51-
$this->assertSame($expectedSource, $actualContents);
52+
if (Kernel::VERSION_ID < 81000) {
53+
$this->assertSame(preg_replace('/\s+/', '', $expectedSource), preg_replace('/\s+/', '', $actualContents));
54+
} else {
55+
$this->assertSame($expectedSource, $actualContents);
56+
}
5257
}
5358

5459
private static function getYamlDataTests(): \Generator

0 commit comments

Comments
 (0)