Commit 33e0ba31 authored by larowlan's avatar larowlan

Issue #2940956 by alexpott: Properly disable resource tracking in the ContainerBuilder

parent 3dad7119
......@@ -27,8 +27,8 @@ class ContainerBuilder extends SymfonyContainerBuilder {
* {@inheritdoc}
*/
public function __construct(ParameterBagInterface $parameterBag = NULL) {
$this->setResourceTracking(FALSE);
parent::__construct($parameterBag);
$this->setResourceTracking(FALSE);
}
/**
......
......@@ -118,4 +118,27 @@ public function testSerialize() {
serialize($container);
}
/**
* Tests constructor and resource tracking disabling.
*
* This test runs in a separate process to ensure the aliased class does not
* affect any other tests.
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function testConstructor() {
class_alias(testInterface::class, 'Symfony\Component\Config\Resource\ResourceInterface');
$container = new ContainerBuilder();
$this->assertFalse($container->isTrackingResources());
}
}
/**
* A test interface for testing ContainerBuilder::__construct().
*
* @see \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testConstructor()
*/
interface testInterface {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment