/**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $currency_locale = $this->configImporter->importCurrencyLocale($form_state->getValues()['locale']);
     drupal_set_message($this->t('The %label has been imported.', ['%label' => $currency_locale->label()]));
     if ($form_state->getTriggeringElement()['#name'] == 'import_edit') {
         $form_state->setRedirectUrl($currency_locale->urlInfo('edit-form'));
     } else {
         $form_state->setRedirectUrl(new Url('entity.currency_locale.collection'));
     }
 }
 /**
  * @covers ::submitForm
  */
 public function testSubmitFormImportEdit()
 {
     $locale = $this->randomMachineName();
     $url = new Url($this->randomMachineName());
     $currency_locale = $this->getMock(CurrencyLocaleInterface::class);
     $currency_locale->expects($this->atLeastOnce())->method('urlInfo')->with('edit-form')->willReturn($url);
     $this->configImporter->expects($this->once())->method('importCurrencyLocale')->with($locale)->willReturn($currency_locale);
     $form = ['actions' => ['import' => ['#name' => 'import'], 'import_edit' => ['#name' => 'import_edit']]];
     $form_state = $this->getMock(FormStateInterface::class);
     $form_state->expects($this->atLeastOnce())->method('getValues')->willReturn(['locale' => $locale]);
     $form_state->expects($this->atLeastOnce())->method('getTriggeringElement')->willReturn($form['actions']['import_edit']);
     $form_state->expects($this->atLeastOnce())->method('setRedirectUrl');
     $this->sut->submitForm($form, $form_state);
 }