Skip to content

Commit 44d6ef9

Browse files
committed
Report the running PHP version in runtime diagnostics
1 parent 241ace0 commit 44d6ef9

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/Commands/RuntimeCheckCommand.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ protected function configure(): void
7474

7575
protected function execute(InputInterface $input, OutputInterface $output): int
7676
{
77+
$output->writeln(sprintf('PHP runtime: %s (%s)', PHP_VERSION, PHP_SAPI));
78+
7779
$missing = [];
7880
$requiredExtensions = $this->requiredExtensions();
7981

‎tests/Commands/RuntimeCheckCommandTest.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function test_runtime_check_passes_when_required_extensions_are_loaded():
2525
$tester = new CommandTester($command);
2626

2727
self::assertSame(Command::SUCCESS, $tester->execute([]));
28+
self::assertStringContainsString(sprintf('PHP runtime: %s (%s)', PHP_VERSION, PHP_SAPI), $tester->getDisplay());
2829
self::assertStringContainsString('Runtime extensions OK', $tester->getDisplay());
2930
}
3031

@@ -37,6 +38,7 @@ public function test_runtime_check_fails_when_required_extensions_are_missing():
3738
$tester = new CommandTester($command);
3839

3940
self::assertSame(Command::FAILURE, $tester->execute([]));
41+
self::assertStringContainsString(sprintf('PHP runtime: %s (%s)', PHP_VERSION, PHP_SAPI), $tester->getDisplay());
4042
self::assertStringContainsString('Missing required runtime extensions: curl', $tester->getDisplay());
4143
}
4244

0 commit comments

Comments
 (0)