From be8081d580e3585695b95c8c8f59ba250da4411c Mon Sep 17 00:00:00 2001 From: Kamil Kokot Date: Thu, 10 Jan 2019 23:29:11 +0100 Subject: [PATCH] Allow to configure the application kernel's debug setting --- .../configuring_application_kernel.feature | 18 ++++++++++++++++++ src/ServiceContainer/SymfonyExtension.php | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/features/configuration/configuring_application_kernel.feature b/features/configuration/configuring_application_kernel.feature index a6d23e5..ef8e489 100644 --- a/features/configuration/configuring_application_kernel.feature +++ b/features/configuration/configuring_application_kernel.feature @@ -75,3 +75,21 @@ Feature: Configuring application kernel """ When I run Behat Then it should pass + + Scenario: Using configured debug setting + Given a Behat configuration containing: + """ + default: + extensions: + FriendsOfBehat\SymfonyExtension: + kernel: + debug: false + """ + And a feature file containing: + """ + Feature: + Scenario: + And the application kernel should have debug disabled + """ + When I run Behat + Then it should pass diff --git a/src/ServiceContainer/SymfonyExtension.php b/src/ServiceContainer/SymfonyExtension.php index 2d7777f..0a8288d 100644 --- a/src/ServiceContainer/SymfonyExtension.php +++ b/src/ServiceContainer/SymfonyExtension.php @@ -58,6 +58,7 @@ final class SymfonyExtension implements Extension ->scalarNode('path')->defaultNull()->end() ->scalarNode('class')->defaultNull()->end() ->scalarNode('environment')->defaultValue('test')->end() + ->booleanNode('debug')->defaultTrue()->end() ->end() ->end() ->end() @@ -100,7 +101,7 @@ final class SymfonyExtension implements Extension { $definition = new Definition($config['class'], [ $config['environment'], - true, + $config['debug'], ]); $definition->addMethodCall('boot'); $definition->setPublic(true);