You are here

public function ContainerBuilderTest::testConstructor in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testConstructor()
  2. 9 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testConstructor()

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

File

core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php, line 123

Class

ContainerBuilderTest
@coversDefaultClass \Drupal\Core\DependencyInjection\ContainerBuilder @group DependencyInjection

Namespace

Drupal\Tests\Core\DependencyInjection

Code

public function testConstructor() {
  class_alias(TestInterface::class, 'Symfony\\Component\\Config\\Resource\\ResourceInterface');
  $container = new ContainerBuilder();
  $this
    ->assertFalse($container
    ->isTrackingResources());
}