OtherTest.php in Ubercart 8.4
File
payment/uc_payment_pack/tests/src/Functional/OtherTest.php
View source
<?php
namespace Drupal\Tests\uc_payment_pack\Functional;
use Drupal\uc_order\Entity\Order;
class OtherTest extends PaymentPackTestBase {
public function testOther() {
$assert = $this
->assertSession();
$other = $this
->createPaymentMethod('other');
$this
->drupalGet('cart/checkout');
$assert
->fieldValueEquals('panes[payment][payment_method]', $other['id']);
$this
->submitForm([], 'Review order');
$assert
->pageTextContains('Other');
$this
->submitForm([], 'Submit order');
$order = Order::load(1);
$this
->assertEquals($other['id'], $order
->getPaymentMethodId(), 'Order has other payment method.');
$this
->drupalGet('user/' . $order
->getOwnerId() . '/orders/' . $order
->id());
$assert
->pageTextContains('Method: Other');
$this
->drupalGet('admin/store/orders/' . $order
->id());
$assert
->pageTextContains('Method: Other');
$this
->drupalGet('admin/store/orders/' . $order
->id() . '/edit');
$assert
->fieldValueEquals('payment_method', $other['id']);
$edit = [
'payment_details[description]' => $this
->randomString(),
];
$this
->submitForm([], 'Save changes');
}
}
Classes
Name |
Description |
OtherTest |
Tests the payment method pack Other payment method. |