You are here

public function PaymentStatusBaseTest::setUp in Payment 8.2

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/Payment/Status/PaymentStatusBaseTest.php, line 74

Class

PaymentStatusBaseTest
@coversDefaultClass \Drupal\payment\Plugin\Payment\Status\PaymentStatusBase

Namespace

Drupal\Tests\payment\Unit\Plugin\Payment\Status

Code

public function setUp() : void {
  $this->defaultDateTime = $this
    ->getMockBuilder(DrupalDateTime::class)
    ->disableOriginalConstructor()
    ->getMock();
  $language = $this
    ->createMock(LanguageInterface::class);
  $this->languageManager = $this
    ->createMock(LanguageManagerInterface::class);
  $this->languageManager
    ->expects($this
    ->any())
    ->method('getCurrentLanguage')
    ->willReturn($language);
  $this->moduleHandler = $this
    ->createMock(ModuleHandlerInterface::class);
  $this->paymentStatusManager = $this
    ->createMock(PaymentStatusManagerInterface::class);
  $configuration = [];
  $this->pluginId = $this
    ->randomMachineName();
  $this->pluginDefinition = array(
    'label' => $this
      ->randomMachineName(),
  );
  $this->sut = $this
    ->getMockBuilder(PaymentStatusBase::class)
    ->setConstructorArgs(array(
    $configuration,
    $this->pluginId,
    $this->pluginDefinition,
    $this->moduleHandler,
    $this->paymentStatusManager,
    $this->defaultDateTime,
  ))
    ->getMockForAbstractClass();
}