class AutomaticUpdatesTestDisableValidatorsServiceProvider in Automatic Updates 8.2
Allows specific validators to be disabled by site settings.
This should only really be used by functional tests. Kernel tests should override their ::register() method to remove service definitions; build tests should stay out of the API/services layer unless absolutely necessary.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\automatic_updates_test_disable_validators\AutomaticUpdatesTestDisableValidatorsServiceProvider
 
 
Expanded class hierarchy of AutomaticUpdatesTestDisableValidatorsServiceProvider
File
- tests/
modules/ automatic_updates_test_disable_validators/ src/ AutomaticUpdatesTestDisableValidatorsServiceProvider.php, line 16  
Namespace
Drupal\automatic_updates_test_disable_validatorsView source
class AutomaticUpdatesTestDisableValidatorsServiceProvider extends ServiceProviderBase {
  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    $validators = Settings::get('automatic_updates_disable_validators', []);
    array_walk($validators, [
      $container,
      'removeDefinition',
    ]);
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            AutomaticUpdatesTestDisableValidatorsServiceProvider:: | 
                  public | function | 
            Modifies existing service definitions. Overrides ServiceProviderBase:: | 
                  |
| 
            ServiceProviderBase:: | 
                  public | function | 
            Registers services to the container. Overrides ServiceProviderInterface:: | 
                  1 |