diff --git a/phpunit.xml b/phpunit.xml index ca01a8661..32fc88344 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,16 +1,11 @@ - + tests/Functional/ - + src/Commands @@ -19,10 +14,15 @@ - - - - - + + + + + + + + + + diff --git a/tests/Functional/TerminusTestBase.php b/tests/Functional/TerminusTestBase.php index 6f7c2351d..28d5ecb29 100644 --- a/tests/Functional/TerminusTestBase.php +++ b/tests/Functional/TerminusTestBase.php @@ -38,7 +38,21 @@ protected static function callTerminus( string $command, ?string $pipeInput = null ): array { - $procCommand = sprintf('%s %s', TERMINUS_BIN_FILE, $command); + $preamble = ''; + foreach ( + [ + 'TERMINUS_HOST', + 'TERMINUS_PORT', + 'TERMINUS_VERIFY_HOST_CERT', + 'TERMINUS_CACHE_DIR', + 'PANTHEON_CERT' + ] as $envVar + ) { + if (false !== getenv($envVar)) { + $preamble .= sprintf('%s=%s ', $envVar, getenv($envVar)); + } + } + $procCommand = sprintf('%s %s %s', $preamble, TERMINUS_BIN_FILE, $command); if (null !== $pipeInput) { $procCommand = sprintf('%s | %s', $pipeInput, $procCommand); } @@ -211,7 +225,7 @@ protected function assertTerminusCommandSucceedsInAttempts( int $attempts = 3 ): void { $this->assertTerminusCommandResultEqualsInAttempts( - fn () => static::callTerminus(sprintf('%s --yes', $command))[1], + fn() => static::callTerminus(sprintf('%s --yes', $command))[1], 0, $attempts );