Skip to content

Commit

Permalink
Register GarbageCollectionHandler when feature is enabled in XML conf…
Browse files Browse the repository at this point in the history
…iguration
  • Loading branch information
sebastianbergmann committed Jun 27, 2023
1 parent dfe2316 commit d7d70ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/TextUI/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use PHPUnit\Runner\Extension\ExtensionBootstrapper;
use PHPUnit\Runner\Extension\Facade as ExtensionFacade;
use PHPUnit\Runner\Extension\PharLoader;
use PHPUnit\Runner\GarbageCollection\GarbageCollectionHandler;
use PHPUnit\Runner\ResultCache\DefaultResultCache;
use PHPUnit\Runner\ResultCache\NullResultCache;
use PHPUnit\Runner\ResultCache\ResultCache;
Expand Down Expand Up @@ -158,6 +159,13 @@ public function run(array $argv): int

$resultCache = $this->initializeTestResultCache($configuration);

if ($configuration->controlGarbageCollector()) {
new GarbageCollectionHandler(
EventFacade::instance(),
$configuration->numberOfTestsBeforeGarbageCollection(),
);

Check warning on line 166 in src/TextUI/Application.php

View check run for this annotation

Codecov / codecov/patch

src/TextUI/Application.php#L163-L166

Added lines #L163 - L166 were not covered by tests
}

EventFacade::instance()->seal();

$timer = new Timer;
Expand Down

0 comments on commit d7d70ea

Please sign in to comment.