Fixed consig customizer tests

This commit is contained in:
Alejandro Celaya
2018-10-06 10:05:25 +02:00
parent fa595f7aa3
commit 3b95925217
9 changed files with 104 additions and 110 deletions

View File

@@ -28,16 +28,15 @@ class UrlShortenerConfigCustomizer implements ConfigCustomizerInterface
public function process(SymfonyStyle $io, CustomizableAppConfig $appConfig): void
{
$io->title('URL SHORTENER');
$urlShortener = $appConfig->getUrlShortener();
$doImport = $appConfig->hasUrlShortener() && $io->confirm('Do you want to keep imported URL shortener config?');
$doImport = $appConfig->hasUrlShortener();
$keysToAskFor = $doImport ? array_diff(self::EXPECTED_KEYS, array_keys($urlShortener)) : self::EXPECTED_KEYS;
if (empty($keysToAskFor)) {
return;
}
$io->title('URL SHORTENER');
foreach ($keysToAskFor as $key) {
$urlShortener[$key] = $this->ask($io, $key);
}