You are here

public function ContainerBuilderTest::testSetAlias 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::testSetAlias()
  2. 9 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetAlias()

@covers ::setAlias

File

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

Class

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

Namespace

Drupal\Tests\Core\DependencyInjection

Code

public function testSetAlias() {
  $container = new ContainerBuilder();
  $container
    ->register('bar');
  $alias = $container
    ->setAlias('foo', 'bar');
  $this
    ->assertTrue($alias
    ->isPublic());
}