From de36c8120d75b9fdf0998ceb7360faecb321acb0 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 27 May 2024 10:39:02 +0200 Subject: [PATCH] remove default value on boolean node, add new dataset on ExtractorTest --- src/Builder/Capacity/Lookup/All.php | 4 ---- src/Configuration/Extractor.php | 1 - tests/functional/Configuration/ExtractorTest.php | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Builder/Capacity/Lookup/All.php b/src/Builder/Capacity/Lookup/All.php index e51c6ec..336be1e 100644 --- a/src/Builder/Capacity/Lookup/All.php +++ b/src/Builder/Capacity/Lookup/All.php @@ -15,10 +15,6 @@ final class All implements Builder private ?Node\Expr $code = null; private string $type = ''; - public function __construct() - { - } - public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self { $this->endpoint = $endpoint; diff --git a/src/Configuration/Extractor.php b/src/Configuration/Extractor.php index c2e1fbb..a9ae46c 100644 --- a/src/Configuration/Extractor.php +++ b/src/Configuration/Extractor.php @@ -239,7 +239,6 @@ public function getConfigTreeBuilder(): Config\Definition\Builder\TreeBuilder ->end() ->end() ->booleanNode('with_enriched_attributes') - ->defaultFalse() ->validate() ->ifTrue(isExpression()) ->then(asExpression()) diff --git a/tests/functional/Configuration/ExtractorTest.php b/tests/functional/Configuration/ExtractorTest.php index 1e89067..bad5ed3 100644 --- a/tests/functional/Configuration/ExtractorTest.php +++ b/tests/functional/Configuration/ExtractorTest.php @@ -82,6 +82,20 @@ public static function validDataProvider(): iterable 'search' => [], ], ]; + yield [ + 'config' => [ + 'method' => 'all', + 'type' => 'category', + 'search' => [], + 'with_enriched_attributes' => true, + ], + 'expected' => [ + 'method' => 'all', + 'type' => 'category', + 'search' => [], + 'with_enriched_attributes' => true, + ], + ]; } #[\PHPUnit\Framework\Attributes\DataProvider('validDataProvider')]