Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap extensions before building test suite #5915

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/TextUI/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,6 @@ public function run(array $argv): int

$this->executeCommandsThatDoNotRequireTheTestSuite($configuration, $cliConfiguration);

$testSuite = $this->buildTestSuite($configuration);

$this->executeCommandsThatRequireTheTestSuite($configuration, $cliConfiguration, $testSuite);

if ($testSuite->isEmpty() && !$configuration->hasCliArguments() && $configuration->testSuite()->isEmpty()) {
$this->execute(new ShowHelpCommand(Result::FAILURE));
}

$pharExtensions = null;
$extensionRequiresCodeCoverageCollection = false;
$extensionReplacesOutput = false;
Expand All @@ -148,6 +140,14 @@ public function run(array $argv): int
$extensionReplacesResultOutput = $bootstrappedExtensions['replacesResultOutput'];
}

$testSuite = $this->buildTestSuite($configuration);

$this->executeCommandsThatRequireTheTestSuite($configuration, $cliConfiguration, $testSuite);

if ($testSuite->isEmpty() && !$configuration->hasCliArguments() && $configuration->testSuite()->isEmpty()) {
$this->execute(new ShowHelpCommand(Result::FAILURE));
}

CodeCoverage::instance()->init(
$configuration,
CodeCoverageFilterRegistry::instance(),
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/extension-xml/phar-extension.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ unlink($traceFile);
--EXPECTF--
PHPUnit Started (PHPUnit %s using %s)
Test Runner Configured
Test Suite Loaded (1 test)
Extension Loaded from PHAR (phpunit/phpunit-test-extension 1.0.0)
Extension Bootstrapped (PHPUnit\TestFixture\MyExtension\MyExtensionBootstrap)
Test Suite Loaded (1 test)
Event Facade Sealed
Test Runner Started
Test Suite Sorted
Expand Down