You are here

function CurrencyLocaleFormTest::testCreate in Currency 8.3

@covers ::create @covers ::__construct

File

tests/src/Unit/Entity/CurrencyLocale/CurrencyLocaleFormTest.php, line 113

Class

CurrencyLocaleFormTest
@coversDefaultClass \Drupal\currency\Entity\CurrencyLocale\CurrencyLocaleForm

Namespace

Drupal\Tests\currency\Unit\Entity\CurrencyLocale

Code

function testCreate() {
  $entity_type_manager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $entity_type_manager
    ->expects($this
    ->once())
    ->method('getStorage')
    ->with('currency_locale')
    ->willReturn($this->currencyLocaleStorage);
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = array(
    array(
      'country_manager',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->countryManager,
    ),
    array(
      'entity_type.manager',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $entity_type_manager,
    ),
    array(
      'link_generator',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->linkGenerator,
    ),
    array(
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ),
  );
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $form = CurrencyLocaleForm::create($container);
  $this
    ->assertInstanceOf(CurrencyLocaleForm::class, $form);
}