You are here

function AddCurrencyTest::testCreate in Currency 8.3

@covers ::create @covers ::__construct

File

tests/src/Unit/Controller/AddCurrencyTest.php, line 57

Class

AddCurrencyTest
@coversDefaultClass \Drupal\currency\Controller\AddCurrency

Namespace

Drupal\Tests\currency\Unit\Controller

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 = array(
    array(
      'entity.form_builder',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->entityFormBuilder,
    ),
    array(
      'entity_type.manager',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $entity_type_manager,
    ),
  );
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $sut = AddCurrency::create($container);
  $this
    ->assertInstanceOf(AddCurrency::class, $sut);
}