class CollectPathsToExcludeFailValidator

Allows to test an excluder which fails on CollectPathsToExcludeEvent.

Hierarchy

Expanded class hierarchy of CollectPathsToExcludeFailValidator

1 string reference to 'CollectPathsToExcludeFailValidator'
package_manager_test_validation.services.yml in core/modules/package_manager/tests/modules/package_manager_test_validation/package_manager_test_validation.services.yml
core/modules/package_manager/tests/modules/package_manager_test_validation/package_manager_test_validation.services.yml
1 service uses CollectPathsToExcludeFailValidator
package_manager.validator.collect_paths_to_exclude_fail in core/modules/package_manager/tests/modules/package_manager_test_validation/package_manager_test_validation.services.yml
Drupal\package_manager_test_validation\CollectPathsToExcludeFailValidator

File

core/modules/package_manager/tests/modules/package_manager_test_validation/src/CollectPathsToExcludeFailValidator.php, line 15

Namespace

Drupal\package_manager_test_validation
View source
class CollectPathsToExcludeFailValidator implements EventSubscriberInterface {
  
  /**
   * Constructs a CollectPathsToExcludeFailValidator object.
   *
   * @param \Drupal\package_manager\ComposerInspector $composerInspector
   *   The Composer inspector service.
   * @param \Drupal\package_manager\PathLocator $pathLocator
   *   The path locator service.
   */
  public function __construct(private readonly ComposerInspector $composerInspector, private readonly PathLocator $pathLocator) {
  }
  
  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() : array {
    return [
      CollectPathsToExcludeEvent::class => 'callToComposer',
    ];
  }
  
  /**
   * Fails when composer.json is deleted to simulate failure on excluders.
   */
  public function callToComposer() : void {
    $this->composerInspector
      ->validate($this->pathLocator
      ->getProjectRoot());
  }

}

Members

Title Sort descending Modifiers Object type Summary
CollectPathsToExcludeFailValidator::callToComposer public function Fails when composer.json is deleted to simulate failure on excluders.
CollectPathsToExcludeFailValidator::getSubscribedEvents public static function
CollectPathsToExcludeFailValidator::__construct public function Constructs a CollectPathsToExcludeFailValidator object.

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