class TestSiteExcluder

Excludes 'sites/simpletest' from stage operations.

@internal This is an internal part of Package Manager and may be changed or removed at any time without warning. External code should not interact with this class.

Hierarchy

  • class \Drupal\package_manager\PathExcluder\TestSiteExcluder implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of TestSiteExcluder

1 file declares its use of TestSiteExcluder
TestSiteExcluderTest.php in core/modules/package_manager/tests/src/Kernel/PathExcluder/TestSiteExcluderTest.php

File

core/modules/package_manager/src/PathExcluder/TestSiteExcluder.php, line 18

Namespace

Drupal\package_manager\PathExcluder
View source
final class TestSiteExcluder implements EventSubscriberInterface {
  
  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() : array {
    return [
      CollectPathsToExcludeEvent::class => 'excludeTestSites',
    ];
  }
  
  /**
   * Excludes sites/simpletest from stage operations.
   *
   * @param \Drupal\package_manager\Event\CollectPathsToExcludeEvent $event
   *   The event object.
   */
  public function excludeTestSites(CollectPathsToExcludeEvent $event) : void {
    // Always exclude automated test directories. If they exist, they will be in
    // the web root.
    $event->addPathsRelativeToWebRoot([
      'sites/simpletest',
    ]);
  }

}

Members

Title Sort descending Modifiers Object type Summary
TestSiteExcluder::excludeTestSites public function Excludes sites/simpletest from stage operations.
TestSiteExcluder::getSubscribedEvents public static function

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