Skip to content

Commit

Permalink
minor #495 Fix test with symfony/config:^7.2 (alexandre-daubois)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x-dev branch.

Discussion
----------

Fix test with `symfony/config:^7.2`

Following symfony/symfony#58490 (comment). Until the Symfony PR, null wasn't supported in boolean nodes and defaulted to true.

Commits
-------

3fd3da1 Fix test with `symfony/config:^7.2`
  • Loading branch information
derrabus committed Nov 6, 2024
2 parents ed0e4a2 + 3fd3da1 commit b0a559d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection;

use Composer\InstalledVersions;
use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\MonologBundle\DependencyInjection\Configuration;
Expand Down Expand Up @@ -534,7 +535,13 @@ public function testWithProcessPsr3Messages(array $configuration, array $process
public function processPsr3MessagesProvider(): iterable
{
yield 'Not specified' => [[], ['enabled' => null]];
yield 'Null' => [['process_psr_3_messages' => null], ['enabled' => true]];

if (version_compare(InstalledVersions::getVersion('symfony/config'), '7.2', '>=')) {
yield 'Null' => [['process_psr_3_messages' => null], ['enabled' => null]];
} else {
yield 'Null' => [['process_psr_3_messages' => null], ['enabled' => true]];
}

yield 'True' => [['process_psr_3_messages' => true], ['enabled' => true]];
yield 'False' => [['process_psr_3_messages' => false], ['enabled' => false]];

Expand Down

0 comments on commit b0a559d

Please sign in to comment.