You are here

public function PaymentStatusFormTest::setUp in Payment 8.2

Same name in this branch
  1. 8.2 tests/src/Unit/Entity/PaymentStatus/PaymentStatusFormTest.php \Drupal\Tests\payment\Unit\Entity\PaymentStatus\PaymentStatusFormTest::setUp()
  2. 8.2 tests/src/Unit/Entity/Payment/PaymentStatusFormTest.php \Drupal\Tests\payment\Unit\Entity\Payment\PaymentStatusFormTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/Entity/PaymentStatus/PaymentStatusFormTest.php, line 87

Class

PaymentStatusFormTest
@coversDefaultClass \Drupal\payment\Entity\PaymentStatus\PaymentStatusForm

Namespace

Drupal\Tests\payment\Unit\Entity\PaymentStatus

Code

public function setUp() : void {
  $this->paymentStatusManager = $this
    ->createMock(PaymentStatusManagerInterface::class);
  $this->paymentStatusStorage = $this
    ->createMock(EntityStorageInterface::class);
  $this->paymentStatus = $this
    ->createMock(PaymentStatusInterface::class);
  $this->pluginSelectorManager = $this
    ->createMock(PluginSelectorManagerInterface::class);
  $this->stringTranslation = $this
    ->getStringTranslationStub();
  $this->paymentStatusPluginType = $this
    ->prophesize(PluginTypeInterface::class);
  $this->messenger = $this
    ->createMock(MessengerInterface::class);
  $this->sut = new PaymentStatusForm($this->stringTranslation, $this->paymentStatusStorage, $this->pluginSelectorManager, $this->paymentStatusPluginType
    ->reveal());
  $this->sut
    ->setEntity($this->paymentStatus);
  $this->sut
    ->setMessenger($this->messenger);
}