diff --git a/src/Commands/Env/CodeRebuildCommand.php b/src/Commands/Env/CodeRebuildCommand.php index cda766b61..2f29b8798 100644 --- a/src/Commands/Env/CodeRebuildCommand.php +++ b/src/Commands/Env/CodeRebuildCommand.php @@ -37,7 +37,7 @@ public function rebuild( $site_env ) { $this->requireSiteIsNotFrozen($site_env); - $site = $this->getSite($site_env); + $site = $this->getSiteById($site_env); $env = $this->getEnv($site_env); if ($env->getName() === 'test' || $env->getName() === 'live') { diff --git a/tests/Functional/EnvCommandsTest.php b/tests/Functional/EnvCommandsTest.php index 531eab5d8..6f28aca3c 100644 --- a/tests/Functional/EnvCommandsTest.php +++ b/tests/Functional/EnvCommandsTest.php @@ -471,4 +471,18 @@ public function testViewCommand() ); $this->assertEquals($expectedUrl, $url); } + + /** + * @test + * @covers \Pantheon\Terminus\Commands\Env\CodeRebuildCommand + * + * @group env + * @group short + */ + public function testCodeRebuild() + { + $this->terminus( + sprintf('env:code-rebuild %s', $this->getSiteEnv()) + ); + } }