Skip to content

Commit 8743611

Browse files
Fix XML loader errors for Symfony 8
1 parent 356815c commit 8743611

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/Unit/DependencyInjection/ConfigurationTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use Symfony\Component\Config\Definition\ConfigurationInterface;
1414
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
1515
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
16+
use Symfony\Component\HttpKernel\Kernel;
17+
use function class_exists;
1618

1719
/**
1820
* @author David Buchmann <[email protected]>
@@ -322,11 +324,17 @@ public function testSupportsAllConfigFormats(): void
322324
],
323325
];
324326

325-
$formats = array_map(fn ($path) => __DIR__.'/../../Resources/Fixtures/'.$path, [
327+
$formats = [
326328
'config/full.yml',
327-
'config/full.xml',
328329
'config/full.php',
329-
]);
330+
];
331+
332+
// XML configuration is not supported in Symfony 8+
333+
if (class_exists('Symfony\Component\DependencyInjection\Loader\XmlFileLoader')) {
334+
$formats[] = 'config/full.xml';
335+
}
336+
337+
$formats = array_map(fn ($path) => __DIR__.'/../../Resources/Fixtures/'.$path, $formats);
330338

331339
foreach ($formats as $format) {
332340
$this->assertProcessedConfigurationEquals($expectedConfiguration, [$format]);

0 commit comments

Comments
 (0)