You are here

function BasicTest::testCreate in Payment 8.2

Same name in this branch
  1. 8.2 tests/src/Unit/Plugin/Payment/MethodConfiguration/BasicTest.php \Drupal\Tests\payment\Unit\Plugin\Payment\MethodConfiguration\BasicTest::testCreate()
  2. 8.2 tests/src/Unit/Plugin/Payment/Method/BasicTest.php \Drupal\Tests\payment\Unit\Plugin\Payment\Method\BasicTest::testCreate()
  3. 8.2 tests/src/Unit/Plugin/Payment/LineItem/BasicTest.php \Drupal\Tests\payment\Unit\Plugin\Payment\LineItem\BasicTest::testCreate()

@covers ::create @covers ::__construct

File

tests/src/Unit/Plugin/Payment/Method/BasicTest.php, line 67

Class

BasicTest
@coversDefaultClass \Drupal\payment\Plugin\Payment\Method\Basic

Namespace

Drupal\Tests\payment\Unit\Plugin\Payment\Method

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = array(
    array(
      'payment.event_dispatcher',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->eventDispatcher,
    ),
    array(
      'module_handler',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->moduleHandler,
    ),
    array(
      'plugin.manager.payment.status',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->paymentStatusManager,
    ),
    array(
      'token',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->token,
    ),
  );
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $sut = Basic::create($container, [], '', $this->pluginDefinition);
  $this
    ->assertInstanceOf(Basic::class, $sut);
}