You are here

public function PaymentReferenceTest::setUp in Payment 8.2

Same name in this branch
  1. 8.2 modules/payment_reference/tests/src/Unit/Element/PaymentReferenceTest.php \Drupal\Tests\payment_reference\Unit\Element\PaymentReferenceTest::setUp()
  2. 8.2 modules/payment_reference/tests/src/Unit/Plugin/Payment/Type/PaymentReferenceTest.php \Drupal\Tests\payment_reference\Unit\Plugin\Payment\Type\PaymentReferenceTest::setUp()
  3. 8.2 modules/payment_reference/tests/src/Unit/Plugin/Field/FieldWidget/PaymentReferenceTest.php \Drupal\Tests\payment_reference\Unit\Plugin\Field\FieldWidget\PaymentReferenceTest::setUp()
  4. 8.2 modules/payment_reference/tests/src/Unit/Plugin/Field/FieldType/PaymentReferenceTest.php \Drupal\Tests\payment_reference\Unit\Plugin\Field\FieldType\PaymentReferenceTest::setUp()

Overrides UnitTestCase::setUp

File

modules/payment_reference/tests/src/Unit/Element/PaymentReferenceTest.php, line 124

Class

PaymentReferenceTest
@coversDefaultClass \Drupal\payment_reference\Element\PaymentReference

Namespace

Drupal\Tests\payment_reference\Unit\Element

Code

public function setUp() : void {
  $this->currentUser = $this
    ->createMock(AccountInterface::class);
  $this->dateFormatter = $this
    ->getMockBuilder(DateFormatter::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->linkGenerator = $this
    ->createMock(LinkGeneratorInterface::class);
  $this->paymentMethodManager = $this
    ->createMock(PaymentMethodManagerInterface::class);
  $this->stringTranslation = $this
    ->getStringTranslationStub();
  $this->paymentMethodType = $this
    ->prophesize(PluginTypeInterface::class);
  $this->paymentQueue = $this
    ->createMock(QueueInterface::class);
  $this->paymentStorage = $this
    ->createMock(EntityStorageInterface::class);
  $this->pluginSelectorManager = $this
    ->createMock(PluginSelectorManagerInterface::class);
  $this->renderer = $this
    ->createMock(RendererInterface::class);
  $this->requestStack = $this
    ->getMockBuilder(RequestStack::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->urlGenerator = $this
    ->createMock(UrlGeneratorInterface::class);
  $configuration = [];
  $plugin_id = $this
    ->randomMachineName();
  $plugin_definition = [];
  $this->sut = new PaymentReference($configuration, $plugin_id, $plugin_definition, $this->requestStack, $this->paymentStorage, $this->stringTranslation, $this->dateFormatter, $this->linkGenerator, $this->renderer, $this->currentUser, $this->pluginSelectorManager, $this->paymentMethodType
    ->reveal(), new Random(), $this->paymentQueue);
}