You are here

public function BraintreeApiIntegrationTest::setUp in Commerce Braintree 8

Overrides OrderKernelTestBase::setUp

File

tests/src/Kernel/BraintreeApiIntegrationTest.php, line 38

Class

BraintreeApiIntegrationTest
Tests the Braintree SDK integration.

Namespace

Drupal\Tests\commerce_braintree\Kernel

Code

public function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('commerce_payment');
  $this
    ->installEntitySchema('commerce_payment_method');
  $this
    ->installConfig('commerce_payment');

  /** @var \Drupal\commerce_payment\Entity\PaymentGateway $gateway */
  $gateway = PaymentGateway::create([
    'id' => 'braintree',
    'label' => 'Braintree',
    'plugin' => 'braintree_hostedfields',
  ]);
  $gateway
    ->getPlugin()
    ->setConfiguration([
    'merchant_id' => 'hy3tktc463w6g7pw',
    'public_key' => 'fsspfgwhnm6by9gk',
    'private_key' => '671d13c9dee5815425f954df590bfc98',
    'merchant_account_id' => [
      'USD' => 'commerceguys',
    ],
    'display_label' => 'Braintree',
    'payment_method_types' => [
      'credit_card',
    ],
  ]);
  $gateway
    ->save();
  $this->gateway = $gateway;
}