function StatusCheckTraitTest::testPathsToExcludeCollected

Tests that StatusCheckTrait will collect paths to exclude.

File

core/modules/package_manager/tests/src/Kernel/StatusCheckTraitTest.php, line 24

Class

StatusCheckTraitTest
@covers \Drupal\package_manager\StatusCheckTrait @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testPathsToExcludeCollected() : void {
    $this->addEventTestListener(function (CollectPathsToExcludeEvent $event) : void {
        $event->add('/junk/drawer');
    }, CollectPathsToExcludeEvent::class);
    $status_check_called = FALSE;
    $this->addEventTestListener(function (StatusCheckEvent $event) use (&$status_check_called) : void {
        $this->assertContains('/junk/drawer', $event->excludedPaths
            ->getAll());
        $status_check_called = TRUE;
    }, StatusCheckEvent::class);
    $this->runStatusCheck($this->createStage(), $this->container
        ->get('event_dispatcher'));
    $this->assertTrue($status_check_called);
}

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