Skip to content

Commit 5d0ea74

Browse files
authored
[minor] add php version to env:list (#2732)
1 parent 3e2a0a8 commit 5d0ea74

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. This projec
55

66
### Added
77

8-
- Add "PHP Runtime Generation" (php_runtime_generation) to the `env:list` command (#2729)
8+
- Add "PHP Runtime Generation" (php_runtime_generation) and "PHP Version" (php_version) to the `env:list` command (#2729, #2732)
99

1010
## 4.0.3 - 2025-09-11
1111

src/Commands/Env/ListCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class ListCommand extends TerminusCommand implements SiteAwareInterface
3434
* connection_mode: Connection Mode
3535
* locked: Locked
3636
* initialized: Initialized
37+
* php_version: PHP Version
3738
* php_runtime_generation: PHP Runtime Generation
3839
* @default-fields id,created,domain,connection_mode,locked,initialized
3940

tests/Functional/EnvCommandsTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,33 @@ public function testListCommandWithPHPRuntimeGeneration()
484484
);
485485
}
486486

487+
/**
488+
* @test
489+
* @covers \Pantheon\Terminus\Commands\Env\ListCommand
490+
*
491+
* @group env
492+
* @group short
493+
*/
494+
public function testListCommandWithPHPVersion()
495+
{
496+
$envs = $this->terminusJsonResponse(
497+
sprintf('env:list %s --fields=id,php_version', $this->getSiteName())
498+
);
499+
$this->assertIsArray($envs);
500+
$env = array_shift($envs);
501+
502+
$this->assertArrayHasKey(
503+
'id',
504+
$env,
505+
'An environment should have "id" field.'
506+
);
507+
$this->assertArrayHasKey(
508+
'php_version',
509+
$env,
510+
'An environment should have "php_version" field when explicitly requested.'
511+
);
512+
}
513+
487514
/**
488515
* @test
489516
* @covers \Pantheon\Terminus\Commands\Env\ViewCommand

0 commit comments

Comments
 (0)