-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI-1435: PHP error - undefined array key handled in pull command #1844
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1844 +/- ##
=========================================
Coverage 92.92% 92.92%
- Complexity 1846 1847 +1
=========================================
Files 123 123
Lines 6964 6966 +2
=========================================
+ Hits 6471 6473 +2
Misses 493 493 ☔ View full report in Codecov by Sentry. |
Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1844/acli.phar
|
src/Command/CommandBase.php
Outdated
@@ -1517,6 +1517,10 @@ private function promptChooseAcsfSite(EnvironmentResponse $cloudEnvironment): mi | |||
foreach ($acsfSites['sites'] as $domain => $acsfSite) { | |||
$choices[] = "{$acsfSite['name']} ($domain)"; | |||
} | |||
if (!count($choices)) { | |||
throw new AcquiaCliException("Could not get ACSF sites"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add a test case to cover this line. I'd suggest copying testRefreshAcsfFiles from PullFilesCommandTest.php and modify it to expect this exception. You'll need to modify mockGetAcsfSites() to return 0 sites to trigger the exception.
Motivation
Fixes CLI-1435
Proposed changes
Alternatives considered
Testing steps
./bin/acli ckc
pull:files
and select an ACSF environment with no sites deployed