function PackageManagerTestValidationServiceProvider::alter
Overrides ServiceProviderBase::alter
File
-
core/
modules/ package_manager/ tests/ modules/ package_manager_test_validation/ src/ PackageManagerTestValidationServiceProvider.php, line 20
Class
- PackageManagerTestValidationServiceProvider
- Modifies container services for testing.
Namespace
Drupal\package_manager_test_validationCode
public function alter(ContainerBuilder $container) : void {
parent::alter($container);
$service_id = StagedDBUpdateValidator::class;
if ($container->hasDefinition($service_id)) {
$container->getDefinition($service_id)
->setClass(StagedDatabaseUpdateValidator::class)
->addMethodCall('setState', [
new Reference('state'),
]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.