You are here

public function PaymentTest::testPayment in Commerce Migrate 3.1.x

Same name in this branch
  1. 3.1.x modules/ubercart/tests/src/Kernel/Migrate/uc7/PaymentTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7\PaymentTest::testPayment()
  2. 3.1.x modules/ubercart/tests/src/Kernel/Migrate/uc6/PaymentTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6\PaymentTest::testPayment()
  3. 3.1.x modules/commerce/tests/src/Kernel/Migrate/commerce1/PaymentTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\PaymentTest::testPayment()
Same name and namespace in other branches
  1. 8.2 modules/commerce/tests/src/Kernel/Migrate/commerce1/PaymentTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\PaymentTest::testPayment()
  2. 3.0.x modules/commerce/tests/src/Kernel/Migrate/commerce1/PaymentTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\PaymentTest::testPayment()

Test line item migration from Drupal 7 to 8.

File

modules/commerce/tests/src/Kernel/Migrate/commerce1/PaymentTest.php, line 100

Class

PaymentTest
Tests payment migration.

Namespace

Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1

Code

public function testPayment() {
  $payment = [
    'id' => 1,
    'order_id' => '2',
    'type' => 'payment_manual',
    'payment_gateway' => 'commerce_payment_example',
    'payment_method' => NULL,
    'amount_number' => '12000.000000',
    'amount_currency_code' => 'USD',
    'refunded_amount_number' => '0.000000',
    'refunded_amount_currency_code' => 'USD',
    'balance_number' => '12000',
    'balance_currency_code' => 'USD',
    'label_value' => 'success',
    'label_rendered' => 'success',
    'created' => '1493287432',
    'changed' => '1493287450',
  ];
  $this
    ->assertPaymentEntity($payment);
  $payment = [
    'id' => 2,
    'order_id' => '3',
    'type' => 'payment_manual',
    'payment_gateway' => 'commerce_payment_example',
    'payment_method' => NULL,
    'amount_number' => '3999.000000',
    'amount_currency_code' => 'USD',
    'refunded_amount_number' => '0.000000',
    'refunded_amount_currency_code' => 'USD',
    'balance_number' => '3999',
    'balance_currency_code' => 'USD',
    'label_value' => 'success',
    'label_rendered' => 'success',
    'created' => '1493287432',
    'changed' => '1493287450',
  ];
  $this
    ->assertPaymentEntity($payment);
}