You are here

function PaymentStatusesDisplayTest::testCreate in Payment 8.2

@covers ::create @covers ::__construct

File

tests/src/Unit/Element/PaymentStatusesDisplayTest.php, line 59

Class

PaymentStatusesDisplayTest
@coversDefaultClass \Drupal\payment\Element\PaymentStatusesDisplay

Namespace

Drupal\Tests\payment\Unit\Element

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = array(
    array(
      'date.formatter',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->dateFormatter,
    ),
    array(
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ),
  );
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $configuration = [];
  $plugin_id = $this
    ->randomMachineName();
  $plugin_definition = [];
  $sut = PaymentStatusesDisplay::create($container, $configuration, $plugin_id, $plugin_definition);
  $this
    ->assertInstanceOf(PaymentStatusesDisplay::class, $sut);
}