You are here

public function PaymentLineItemsInputTest::setUp in Payment 8.2

Overrides UnitTestCase::setUp

File

tests/src/Unit/Element/PaymentLineItemsInputTest.php, line 55

Class

PaymentLineItemsInputTest
@coversDefaultClass \Drupal\payment\Element\PaymentLineItemsInput

Namespace

Drupal\Tests\payment\Unit\Element

Code

public function setUp() : void {
  $this->paymentLineItemManager = $this
    ->createMock(PaymentLineItemManagerInterface::class);
  $this->renderer = $this
    ->createMock(RendererInterface::class);
  $this->stringTranslation = $this
    ->getStringTranslationStub();
  $container = new Container();
  $container
    ->set('renderer', $this->renderer);
  $container
    ->set('plugin.manager.payment.line_item', $this->paymentLineItemManager);
  \Drupal::setContainer($container);
  $configuration = [];
  $plugin_id = $this
    ->randomMachineName();
  $plugin_definition = [];
  $this->sut = new PaymentLineItemsInput($configuration, $plugin_id, $plugin_definition, $this->stringTranslation, $this->renderer, $this->paymentLineItemManager);
}