You are here

public function PaymentMethodBaseTestBase::setUp in Payment 8.2

Overrides UnitTestCase::setUp

2 calls to PaymentMethodBaseTestBase::setUp()
BasicTest::setUp in tests/src/Unit/Plugin/Payment/Method/BasicTest.php
PaymentMethodBaseTest::setUp in tests/src/Unit/Plugin/Payment/Method/PaymentMethodBaseTest.php
2 methods override PaymentMethodBaseTestBase::setUp()
BasicTest::setUp in tests/src/Unit/Plugin/Payment/Method/BasicTest.php
PaymentMethodBaseTest::setUp in tests/src/Unit/Plugin/Payment/Method/PaymentMethodBaseTest.php

File

tests/src/Unit/Plugin/Payment/Method/PaymentMethodBaseTestBase.php, line 71

Class

PaymentMethodBaseTestBase
Provides a base for tests for classes that extend \Drupal\payment\Plugin\Payment\Method\PaymentMethodBase.

Namespace

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

Code

public function setUp() : void {
  parent::setUp();
  $this->eventDispatcher = $this
    ->createMock(EventDispatcherInterface::class);
  $this->moduleHandler = $this
    ->createMock(ModuleHandlerInterface::class);
  $this->paymentStatusManager = $this
    ->createMock(PaymentStatusManagerInterface::class);
  $this->token = $this
    ->getMockBuilder(Token::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->pluginDefinition = [
    'active' => TRUE,
    'message_text' => $this
      ->randomMachineName(),
    'message_text_format' => $this
      ->randomMachineName(),
  ];
  $this->pluginId = $this
    ->randomMachineName();
  $this->cacheCContextManager = $this
    ->getMockBuilder(CacheContextsManager::class)
    ->disableOriginalConstructor()
    ->getMock();
  $container = new Container();
  $container
    ->set('cache_contexts_manager', $this->cacheCContextManager);
  \Drupal::setContainer($container);
}