function ProxyServicesPassTest::testContainerWithLazyServicesWithoutProxyClass

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\ProxyServicesPassTest::testContainerWithLazyServicesWithoutProxyClass()
  2. 8.9.x core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\ProxyServicesPassTest::testContainerWithLazyServicesWithoutProxyClass()
  3. 10 core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\ProxyServicesPassTest::testContainerWithLazyServicesWithoutProxyClass()

@covers ::process

File

core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php, line 71

Class

ProxyServicesPassTest
@coversDefaultClass \Drupal\Core\DependencyInjection\Compiler\ProxyServicesPass @group DependencyInjection

Namespace

Drupal\Tests\Core\DependencyInjection\Compiler

Code

public function testContainerWithLazyServicesWithoutProxyClass() : void {
    $container = new ContainerBuilder();
    $container->register('path.current', CurrentPathStack::class)
        ->setLazy(TRUE);
    $this->expectException(InvalidArgumentException::class);
    $this->proxyServicesPass
        ->process($container);
}

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