You are here

function PluginBasedExchangeRateProviderFormTest::testCreate in Currency 8.3

Same name in this branch
  1. 8.3 tests/src/Unit/Controller/PluginBasedExchangeRateProviderFormTest.php \Drupal\Tests\currency\Unit\Controller\PluginBasedExchangeRateProviderFormTest::testCreate()
  2. 8.3 tests/src/Unit/Form/PluginBasedExchangeRateProviderFormTest.php \Drupal\Tests\currency\Unit\Form\PluginBasedExchangeRateProviderFormTest::testCreate()

@covers ::create @covers ::__construct

File

tests/src/Unit/Form/PluginBasedExchangeRateProviderFormTest.php, line 77

Class

PluginBasedExchangeRateProviderFormTest
@coversDefaultClass \Drupal\currency\Form\PluginBasedExchangeRateProviderForm

Namespace

Drupal\Tests\currency\Unit\Form

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = [
    [
      'plugin.manager.currency.exchange_rate_provider',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->currencyExchangeRateProviderManager,
    ],
    [
      'currency.exchange_rate_provider',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->exchangeRateProvider,
    ],
    [
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $sut = PluginBasedExchangeRateProviderForm::create($container);
  $this
    ->assertInstanceOf(PluginBasedExchangeRateProviderForm::class, $sut);
}