You are here

function CurrencyTest::testCreate in Currency 8.3

Same name in this branch
  1. 8.3 tests/src/Unit/Plugin/views/filter/CurrencyTest.php \Drupal\Tests\currency\Unit\Plugin\views\filter\CurrencyTest::testCreate()
  2. 8.3 tests/src/Unit/Plugin/views/field/CurrencyTest.php \Drupal\Tests\currency\Unit\Plugin\views\field\CurrencyTest::testCreate()

@covers ::create @covers ::__construct

File

tests/src/Unit/Plugin/views/filter/CurrencyTest.php, line 48

Class

CurrencyTest
@coversDefaultClass \Drupal\currency\Plugin\views\filter\Currency

Namespace

Drupal\Tests\currency\Unit\Plugin\views\filter

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = [
    [
      'currency.form_helper',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->formHelper,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $configuration = [];
  $plugin_id = $this
    ->randomMachineName();
  $plugin_definition = [];
  $sut = Currency::create($container, $configuration, $plugin_id, $plugin_definition);
  $this
    ->assertInstanceOf(Currency::class, $sut);
}