Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. This projec
### Added

- Add "PHP Runtime Generation" (php_runtime_generation) and "PHP Version" (php_version) to the `env:list` command (#2729, #2732)
- Fix output of drush_version in `env:info` (#2736)

## 4.0.3 - 2025-09-11

Expand Down
3 changes: 2 additions & 1 deletion src/Models/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ public function getPrimaryDomainModel()
*/
public function getDrushVersion()
{
return $this->settings('drush_version');
return $this->settings('appserver_runtime')->drush_version;
}

/**
Expand Down Expand Up @@ -957,6 +957,7 @@ public function serialize()
'initialized' => $this->isInitialized(),
'connection_mode' => $this->get('connection_mode'),
'php_version' => $this->getPHPVersion(),
'drush_version' => $this->getDrushVersion(),
'php_runtime_generation' => $this->getPHPRuntimeGeneration(),
];
}
Expand Down
23 changes: 23 additions & 0 deletions tests/Functional/EnvCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,29 @@ public function testInfoCommand()
);
}

/**
* @test
* @covers \Pantheon\Terminus\Commands\Env\InfoCommand
*
* @group env
* @group short
*/
public function testInfoCommandWithDrushVersion()
{
$envInfo = $this->terminusJsonResponse(
sprintf('env:info %s --fields=drush_version', $this->getSiteEnv())
);
$this->assertArrayHasKey(
'drush_version',
$envInfo,
'Environment info should have "drush_version" field when explicitly requested.'
);
$this->assertNotEmpty(
$envInfo['drush_version'],
'Environment info "drush_version" should not be empty.'
);
}

/**
* @test
* @covers \Pantheon\Terminus\Commands\Env\MetricsCommand
Expand Down
Loading