You are here

protected function PaymentMethodTest::setUp in Commerce Core 8.2

Same name in this branch
  1. 8.2 modules/payment/tests/src/Functional/PaymentMethodTest.php \Drupal\Tests\commerce_payment\Functional\PaymentMethodTest::setUp()
  2. 8.2 modules/payment/tests/src/FunctionalJavascript/PaymentMethodTest.php \Drupal\Tests\commerce_payment\FunctionalJavascript\PaymentMethodTest::setUp()
  3. 8.2 modules/payment/tests/src/Kernel/Entity/PaymentMethodTest.php \Drupal\Tests\commerce_payment\Kernel\Entity\PaymentMethodTest::setUp()

Overrides CommerceBrowserTestBase::setUp

File

modules/payment/tests/src/Functional/PaymentMethodTest.php, line 49

Class

PaymentMethodTest
Tests the payment method UI.

Namespace

Drupal\Tests\commerce_payment\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $permissions = [
    'manage own commerce_payment_method',
  ];
  $this->user = $this
    ->drupalCreateUser($permissions);
  $this
    ->drupalLogin($this->user);
  $this->store
    ->set('billing_countries', [
    'FR',
    'US',
  ]);
  $this->store
    ->save();
  $this->collectionUrl = 'user/' . $this->user
    ->id() . '/payment-methods';

  /** @var \Drupal\commerce_payment\Entity\PaymentGatewayInterface $payment_gateway */
  $this->paymentGateway = $this
    ->createEntity('commerce_payment_gateway', [
    'id' => 'example',
    'label' => 'Example',
    'plugin' => 'example_onsite',
  ]);
}