You are here

protected 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/Plugin/Field/FieldWidget/PaymentReferenceTest.php, line 70

Class

PaymentReferenceTest
@coversDefaultClass \Drupal\payment_reference\Plugin\Field\FieldWidget\PaymentReference

Namespace

Drupal\Tests\payment_reference\Unit\Plugin\Field\FieldWidget

Code

protected function setUp() : void {
  $this->fieldDefinition = $this
    ->createMock(FieldDefinitionInterface::class);
  $this->configFactoryConfiguration = array(
    'payment_reference.payment_type' => array(
      'limit_allowed_plugins' => TRUE,
      'allowed_plugin_ids' => array(
        $this
          ->randomMachineName(),
      ),
      'plugin_selector_id' => $this
        ->randomMachineName(),
    ),
  );
  $this->configFactory = $this
    ->getConfigFactoryStub($this->configFactoryConfiguration);
  $this->currentUser = $this
    ->createMock(AccountInterface::class);
  $this->paymentFactory = $this
    ->createMock(PaymentFactoryInterface::class);
  $this->sut = new PaymentReference($this
    ->randomMachineName(), [], $this->fieldDefinition, [], [], $this->configFactory, $this->currentUser, $this->paymentFactory);
}