public function UpgradePathTestBase::containerBuild

Overrides some core services for the upgrade tests.

1 call to UpgradePathTestBase::containerBuild()

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php, line 319
Definition of Drupal\system\Tests\Upgrade\UpgradePathTestBase.

Class

UpgradePathTestBase
Perform end-to-end tests of the upgrade path.

Namespace

Drupal\system\Tests\Upgrade

Code

public function containerBuild(ContainerBuilder $container) {

  // Keep the container object around for tests.
  $this->container = $container;
  $container
    ->register('config.storage', 'Drupal\\Core\\Config\\FileStorage')
    ->addArgument($this->configDirectories[CONFIG_ACTIVE_DIRECTORY]);
  if ($this->container
    ->hasDefinition('path_processor_alias')) {

    // Prevent the alias-based path processor, which requires a url_alias db
    // table, from being registered to the path processor manager. We do this
    // by removing the tags that the compiler pass looks for. This means the
    // url generator can safely be used within upgrade path tests.
    $definition = $this->container
      ->getDefinition('path_processor_alias');
    $definition
      ->clearTag('path_processor_inbound')
      ->clearTag('path_processor_outbound');
  }
}