Skip to content

Commit 0679bd6

Browse files
committed
Skip XML config tests with Symfony 8.0
1 parent d4f240d commit 0679bd6

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</testsuite>
2020
</testsuites>
2121

22-
<source ignoreSuppressionOfDeprecations="true" restrictNotices="true" restrictWarnings="true">
22+
<source restrictNotices="true" restrictWarnings="true">
2323
<include>
2424
<directory>./src/</directory>
2525
</include>

tests/DependencyInjection/FixtureMonologExtensionTestCase.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection;
1313

1414
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
15+
use Monolog\Handler\NoopHandler;
1516
use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\LoggerChannelPass;
1617
use Symfony\Bundle\MonologBundle\DependencyInjection\MonologExtension;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -191,9 +192,11 @@ public function testPsr3MessageProcessingDisabledOnNullHandler()
191192

192193
public function testHandlersV2()
193194
{
194-
$this->getContainer('handlers');
195+
$container = $this->getContainer('handlers');
195196

196-
$this->expectNotToPerformAssertions();
197+
$this->assertTrue($container->hasDefinition('monolog.handler.noop'));
198+
$this->assertSame(NoopHandler::class, $container->getDefinition('monolog.handler.noop')->getClass());
199+
$this->assertSame(['DEBUG', true], $container->getDefinition('monolog.handler.noop')->getArguments());
197200
}
198201

199202
public function testPsr3MessageProcessingDisabled()

tests/DependencyInjection/XmlMonologExtensionTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@
1919
/**
2020
* XML configuration deprecated since Symfony 7.4.
2121
*/
22-
#[Group('legacy')]
2322
class XmlMonologExtensionTest extends FixtureMonologExtensionTestCase
2423
{
2524
protected function loadFixture(ContainerBuilder $container, string $fixture)
2625
{
26+
if (!class_exists(XmlFileLoader::class)) {
27+
$this->markTestSkipped('The XML configuration has been removed in Symfony 8.0.');
28+
}
29+
30+
$this->expectUserDeprecationMessage('Since symfony/dependency-injection 7.4: XML configuration format is deprecated, use YAML or PHP instead.');
31+
2732
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/xml'));
2833
$loader->load($fixture.'.xml');
2934
}

0 commit comments

Comments
 (0)