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

Skip to content

Commit 25b961a

Browse files
ro0NLnicolas-grekas
authored andcommitted
[DI] Fix suspicious test
1 parent f3f7721 commit 25b961a

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)