You are here

function CurrencyLocalizeTest::testCreate in Currency 8.3

@covers ::create @covers ::__construct

File

tests/src/Unit/Plugin/Filter/CurrencyLocalizeTest.php, line 103

Class

CurrencyLocalizeTest
@coversDefaultClass \Drupal\currency\Plugin\Filter\CurrencyLocalize

Namespace

Drupal\Tests\currency\Unit\Plugin\Filter

Code

function testCreate() {
  $entity_type_manager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $entity_type_manager
    ->expects($this
    ->atLeastOnce())
    ->method('getStorage')
    ->with('currency')
    ->willReturn($this->currencyStorage);
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = [
    [
      'entity_type.manager',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $entity_type_manager,
    ],
    [
      'currency.input',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->input,
    ],
    [
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $sut = CurrencyLocalize::create($container, [], '', $this->pluginDefinition);
  $this
    ->assertInstanceOf(CurrencyLocalize::class, $sut);
}