diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f7531bfd..7c3f25df8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. This projec ### Added -- Add "PHP Runtime Generation" (php_runtime_generation) to the `env:list` command (#2729) +- Add "PHP Runtime Generation" (php_runtime_generation) and "PHP Version" (php_version) to the `env:list` command (#2729, #2732) ## 4.0.3 - 2025-09-11 diff --git a/src/Commands/Env/ListCommand.php b/src/Commands/Env/ListCommand.php index e0766529e..c7c1d0a33 100644 --- a/src/Commands/Env/ListCommand.php +++ b/src/Commands/Env/ListCommand.php @@ -34,6 +34,7 @@ class ListCommand extends TerminusCommand implements SiteAwareInterface * connection_mode: Connection Mode * locked: Locked * initialized: Initialized + * php_version: PHP Version * php_runtime_generation: PHP Runtime Generation * @default-fields id,created,domain,connection_mode,locked,initialized diff --git a/tests/Functional/EnvCommandsTest.php b/tests/Functional/EnvCommandsTest.php index 161a4fd60..8002c10be 100644 --- a/tests/Functional/EnvCommandsTest.php +++ b/tests/Functional/EnvCommandsTest.php @@ -484,6 +484,33 @@ public function testListCommandWithPHPRuntimeGeneration() ); } + /** + * @test + * @covers \Pantheon\Terminus\Commands\Env\ListCommand + * + * @group env + * @group short + */ + public function testListCommandWithPHPVersion() + { + $envs = $this->terminusJsonResponse( + sprintf('env:list %s --fields=id,php_version', $this->getSiteName()) + ); + $this->assertIsArray($envs); + $env = array_shift($envs); + + $this->assertArrayHasKey( + 'id', + $env, + 'An environment should have "id" field.' + ); + $this->assertArrayHasKey( + 'php_version', + $env, + 'An environment should have "php_version" field when explicitly requested.' + ); + } + /** * @test * @covers \Pantheon\Terminus\Commands\Env\ViewCommand