Skip to content

Commit f82548c

Browse files
committed
Add php_version as optional in env:list
1 parent 3e2a0a8 commit f82548c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

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)