You are here

function PaymentStatusLabelTest::testCreate in Payment 8.2

@covers ::create @covers ::__construct

File

tests/src/Unit/Plugin/views/field/PaymentStatusLabelTest.php, line 60

Class

PaymentStatusLabelTest
@coversDefaultClass \Drupal\payment\Plugin\views\field\PaymentStatusLabel

Namespace

Drupal\Tests\payment\Unit\Plugin\views\field

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = array(
    array(
      'plugin.manager.payment.status',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->paymentStatusManager,
    ),
  );
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $configuration = [];
  $plugin_id = $this
    ->randomMachineName();
  $plugin_definition = [];
  $sut = PaymentStatusLabel::create($container, $configuration, $plugin_id, $plugin_definition);
  $this
    ->assertInstanceOf(PaymentStatusLabel::class, $sut);
}