You are here

public function ConfigImporterTest::testImportCurrencyLocaleWithExistingCurrency in Currency 8.3

@covers ::importCurrencyLocale

File

tests/src/Unit/ConfigImporterTest.php, line 283

Class

ConfigImporterTest
@coversDefaultClass \Drupal\currency\ConfigImporter

Namespace

Drupal\Tests\currency\Unit

Code

public function testImportCurrencyLocaleWithExistingCurrency() {
  $locale = $this
    ->randomMachineName();
  $currency_locale = $this
    ->createMock(CurrencyLocaleInterface::class);
  $this->currencyLocaleStorage
    ->expects($this
    ->never())
    ->method('create');
  $this->currencyLocaleStorage
    ->expects($this
    ->once())
    ->method('load')
    ->with($locale)
    ->willReturn($currency_locale);
  $this->configStorage
    ->expects($this
    ->never())
    ->method('read');
  $this->sut
    ->setConfigStorage($this->configStorage);
  $this
    ->assertFalse($this->sut
    ->importCurrencyLocale($locale));
}