function ContainerBuilderTest::testSetAlias

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetAlias()
  2. 10 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testSetAlias()
  3. 11.x 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 81

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.