You are here

function FixedRatesOperationsProviderTest::testCreate in Currency 8.3

@covers ::create @covers ::__construct

File

tests/src/Unit/Plugin/Currency/ExchangeRateProvider/FixedRatesOperationsProviderTest.php, line 55

Class

FixedRatesOperationsProviderTest
@coversDefaultClass \Drupal\currency\Plugin\Currency\ExchangeRateProvider\FixedRatesOperationsProvider

Namespace

Drupal\Tests\currency\Unit\Plugin\Currency\ExchangeRateProvider

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = [
    [
      'redirect.destination',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->redirectDestination,
    ],
    [
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);

  /** @var \Drupal\plugin\PluginType\DefaultPluginTypeOperationsProvider $sut_class */
  $sut_class = get_class($this->sut);
  $sut = $sut_class::create($container);
  $this
    ->assertInstanceOf($sut_class, $sut);
}