Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 13e5773

Browse files
minor #31944 [DI] Fix suspicious test (ro0NL)
This PR was merged into the 4.2 branch. Discussion ---------- [DI] Fix suspicious test | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #31942 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> cc @nicolas-grekas Commits ------- 25b961a [DI] Fix suspicious test
2 parents e2660e0 + 25b961a commit 13e5773

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Symfony/Component/Config/Definition/Exception/TreeWithoutRootNodeException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
/**
1515
* @author Roland Franssen <[email protected]>
16+
*
17+
* @internal
1618
*/
1719
class TreeWithoutRootNodeException extends \RuntimeException
1820
{

src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,15 @@ public function testEnvWithVariableNode(): void
226226

227227
/**
228228
* @group legacy
229+
* @expectedDeprecation A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.
229230
*/
230231
public function testConfigurationWithoutRootNode(): void
231232
{
232233
$container = new ContainerBuilder();
233234
$container->registerExtension(new EnvExtension(new EnvConfigurationWithoutRootNode()));
234-
$container->loadFromExtension('env_extension');
235+
$container->loadFromExtension('env_extension', ['foo' => 'bar']);
235236

236-
$this->doProcess($container);
237-
238-
$this->addToAssertionCount(1);
237+
(new ValidateEnvPlaceholdersPass())->process($container);
239238
}
240239

241240
public function testEmptyConfigFromMoreThanOneSource()
@@ -332,7 +331,7 @@ class EnvConfigurationWithoutRootNode implements ConfigurationInterface
332331
{
333332
public function getConfigTreeBuilder()
334333
{
335-
return new TreeBuilder('env_extension');
334+
return new TreeBuilder();
336335
}
337336
}
338337

0 commit comments

Comments
 (0)