ProxyServicesPass example


  protected $proxyServicesPass;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->proxyServicesPass = new ProxyServicesPass();
  }

  /** * @covers ::process */
  public function testContainerWithoutLazyServices() {
    $container = new ContainerBuilder();
    $container->register('plugin_cache_clearer', 'Drupal\Core\Plugin\CachedDiscoveryClearer');

    $this->proxyServicesPass->process($container);

    
$container->register('stream_wrapper.private', 'Drupal\Core\StreamWrapper\PrivateStream')
        ->addTag('stream_wrapper', ['scheme' => 'private']);
    }

    // Add the compiler pass that lets service providers modify existing     // service definitions. This pass must come first so that later     // list-building passes are operating on the post-alter services list.     $container->addCompilerPass(new ModifyServiceDefinitionsPass());

    $container->addCompilerPass(new DevelopmentSettingsPass());

    $container->addCompilerPass(new ProxyServicesPass());

    $container->addCompilerPass(new BackendCompilerPass());

    $container->addCompilerPass(new CorsCompilerPass());

    $container->addCompilerPass(new StackedKernelPass());

    $container->addCompilerPass(new StackedSessionHandlerPass());

    $container->addCompilerPass(new MainContentRenderersPass());

    
Home | Imprint | This part of the site doesn't use cookies.