Skip to content

Commit

Permalink
Merge pull request #892 from dannyvw/profiler
Browse files Browse the repository at this point in the history
Fix default profiler value
  • Loading branch information
goetas committed Sep 12, 2022
2 parents f91b701 + 68583b3 commit 408ad72
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getConfigTreeBuilder()
$root = $tb->root('jms_serializer')->children();
}

$root->booleanNode('profiler')->defaultTrue($this->debug)->end();
$root->booleanNode('profiler')->defaultValue($this->debug)->end();

$this->addHandlersSection($root);
$this->addSubscribersSection($root);
Expand Down
13 changes: 13 additions & 0 deletions Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,17 @@ public function testJsonSerializationVisitorDefaultOptions()

$this->assertEquals(1024 /*JSON_PRESERVE_ZERO_FRACTION*/, $config['visitors']['json_serialization']['options']);
}

public function testDefaultProfiler()
{
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(true), []);

$this->assertSame(true, $config['profiler']);

$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(false), []);

$this->assertSame(false, $config['profiler']);
}
}

0 comments on commit 408ad72

Please sign in to comment.