PaymentGatewayTest.php in Commerce Migrate 3.1.x
Same filename in this branch
- 3.1.x modules/ubercart/tests/src/Kernel/Migrate/uc7/PaymentGatewayTest.php
- 3.1.x modules/ubercart/tests/src/Kernel/Migrate/uc6/PaymentGatewayTest.php
- 3.1.x modules/commerce/tests/src/Kernel/Migrate/commerce1/PaymentGatewayTest.php
- 3.1.x modules/ubercart/tests/src/Kernel/Plugin/migrate/source/PaymentGatewayTest.php
- 3.1.x 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}
*/
protected static $modules = [
'commerce_order',
'commerce_payment',
'commerce_price',
'commerce_store',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
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. |