Skip to content

Commit 3e2a0a8

Browse files
authored
[minor] add php runtime generation to env:list (#2729)
1 parent a848ae9 commit 3e2a0a8

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This projec
33

44
## 4.0.4-dev
55

6+
### Added
7+
8+
- Add "PHP Runtime Generation" (php_runtime_generation) to the `env:list` command (#2729)
9+
610
## 4.0.3 - 2025-09-11
711

812
### Added

src/Commands/Env/ListCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ class ListCommand extends TerminusCommand implements SiteAwareInterface
3434
* connection_mode: Connection Mode
3535
* locked: Locked
3636
* initialized: Initialized
37-
* @return RowsOfFields
37+
* php_runtime_generation: PHP Runtime Generation
38+
* @default-fields id,created,domain,connection_mode,locked,initialized
39+
40+
* @return RowsOfFields
3841
*
3942
* @param string $site_id Site name
4043
*

src/Models/Environment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ public function getPHPVersion()
690690
*/
691691
public function getPHPRuntimeGeneration()
692692
{
693-
return $this->settings('appserver_runtime')->php_runtime_generation;
693+
return $this->settings('appserver_runtime')->php_runtime_generation;
694694
}
695695

696696
/**

tests/Functional/EnvCommandsTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,33 @@ public function testListCommand()
457457
);
458458
}
459459

460+
/**
461+
* @test
462+
* @covers \Pantheon\Terminus\Commands\Env\ListCommand
463+
*
464+
* @group env
465+
* @group short
466+
*/
467+
public function testListCommandWithPHPRuntimeGeneration()
468+
{
469+
$envs = $this->terminusJsonResponse(
470+
sprintf('env:list %s --fields=id,php_runtime_generation', $this->getSiteName())
471+
);
472+
$this->assertIsArray($envs);
473+
$env = array_shift($envs);
474+
475+
$this->assertArrayHasKey(
476+
'id',
477+
$env,
478+
'An environment should have "id" field.'
479+
);
480+
$this->assertArrayHasKey(
481+
'php_runtime_generation',
482+
$env,
483+
'An environment should have "php_runtime_generation" field when explicitly requested.'
484+
);
485+
}
486+
460487
/**
461488
* @test
462489
* @covers \Pantheon\Terminus\Commands\Env\ViewCommand

0 commit comments

Comments
 (0)