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
-------

25b961aadc [DI] Fix suspicious test
This commit is contained in:
Nicolas Grekas 2019-06-08 08:03:01 +02:00
commit 13e5773132
2 changed files with 6 additions and 5 deletions

View File

@ -13,6 +13,8 @@ namespace Symfony\Component\Config\Definition\Exception;
/**
* @author Roland Franssen <franssen.roland@gmail.com>
*
* @internal
*/
class TreeWithoutRootNodeException extends \RuntimeException
{

View File

@ -226,16 +226,15 @@ class ValidateEnvPlaceholdersPassTest extends TestCase
/**
* @group legacy
* @expectedDeprecation A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.
*/
public function testConfigurationWithoutRootNode(): void
{
$container = new ContainerBuilder();
$container->registerExtension(new EnvExtension(new EnvConfigurationWithoutRootNode()));
$container->loadFromExtension('env_extension');
$container->loadFromExtension('env_extension', ['foo' => 'bar']);
$this->doProcess($container);
$this->addToAssertionCount(1);
(new ValidateEnvPlaceholdersPass())->process($container);
}
public function testEmptyConfigFromMoreThanOneSource()
@ -332,7 +331,7 @@ class EnvConfigurationWithoutRootNode implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
return new TreeBuilder('env_extension');
return new TreeBuilder();
}
}