PaymentGatewayTest.php in Commerce Migrate 8.2
Same filename in this branch
- 8.2 modules/ubercart/tests/src/Kernel/Migrate/uc7/PaymentGatewayTest.php
- 8.2 modules/ubercart/tests/src/Kernel/Migrate/uc6/PaymentGatewayTest.php
- 8.2 modules/commerce/tests/src/Kernel/Migrate/commerce1/PaymentGatewayTest.php
- 8.2 modules/ubercart/tests/src/Kernel/Plugin/migrate/source/PaymentGatewayTest.php
- 8.2 modules/commerce/tests/src/Kernel/Plugin/migrate/source/commerce1/PaymentGatewayTest.php
Same filename and directory in other branches
File
modules/commerce/tests/src/Kernel/Migrate/commerce1/PaymentGatewayTest.phpView source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1;
use Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait;
use Drupal\commerce_payment\Entity\PaymentGateway;
/**
* Tests payment gateway migration.
*
* @group commerce_migrate
* @group commerce_migrate_commerce1
*/
class PaymentGatewayTest extends Commerce1TestBase {
use CommerceMigrateTestTrait;
/**
* {@inheritdoc}
*/
public static $modules = [
'commerce_order',
'commerce_payment',
'commerce_price',
'commerce_store',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this
->executeMigration('commerce1_payment_gateway');
}
/**
* Asserts a payment gateway entity.
*
* @param string $id
* The payment gateway id.
* @param string $label
* The payment gateway label.
* @param int $weight
* The payment gateway weight.
*/
private function assertPaymentGatewayEntity($id, $label, $weight) {
$gateway = PaymentGateway::load($id);
$this
->assertInstanceOf(PaymentGateway::class, $gateway);
$this
->assertSame($label, $gateway
->label());
$this
->assertSame($weight, $gateway
->getWeight());
}
/**
* Tests payment migration.
*/
public function testPayment() {
$this
->assertPaymentGatewayEntity('commerce_payment_example', 'commerce_payment_example', NULL);
}
}
Classes
Name | Description |
---|---|
PaymentGatewayTest | Tests payment gateway migration. |