public function CurrencyLocaleImportFormTest::testBuildFormWithoutImportableCurrencies in Currency 8.3
Same name in this branch
- 8.3 tests/src/Unit/Controller/CurrencyLocaleImportFormTest.php \Drupal\Tests\currency\Unit\Controller\CurrencyLocaleImportFormTest::testBuildFormWithoutImportableCurrencies()
- 8.3 tests/src/Unit/Form/CurrencyLocaleImportFormTest.php \Drupal\Tests\currency\Unit\Form\CurrencyLocaleImportFormTest::testBuildFormWithoutImportableCurrencies()
@covers ::buildForm
File
- tests/
src/ Unit/ Form/ CurrencyLocaleImportFormTest.php, line 103
Class
- CurrencyLocaleImportFormTest
- @coversDefaultClass \Drupal\currency\Form\CurrencyLocaleImportForm
Namespace
Drupal\Tests\currency\Unit\FormCode
public function testBuildFormWithoutImportableCurrencies() {
$this->configImporter
->expects($this
->once())
->method('getImportableCurrencyLocales')
->willReturn([]);
$form_state = $this
->createMock(FormStateInterface::class);
$form = $this->sut
->buildForm([], $form_state);
// There should be one element and it must not be the currency selector or a
// group of actions.
$this
->assertCount(1, $form);
$this
->assertArrayNotHasKey('actions', $form);
$this
->assertArrayNotHasKey('locale', $form);
}