public function UbercartPaymentPaneTestCase::testPaymentMethodOptions in Ubercart 7.3
Verifies checkout page presents all enabled payment methods.
File
- payment/
uc_payment/ tests/ uc_payment.test, line 33 - Ubercart payment related tests.
Class
- UbercartPaymentPaneTestCase
- Tests the checkout payment pane.
Code
public function testPaymentMethodOptions() {
// No payment methods.
variable_set('uc_payment_method_check_checkout', FALSE);
$this
->drupalGet('cart/checkout');
$this
->assertText('Checkout cannot be completed without any payment methods enabled. Please contact an administrator to resolve the issue.');
// Single payment method.
variable_set('uc_payment_method_check_checkout', TRUE);
$this
->drupalGet('cart/checkout');
$this
->assertNoText('Select a payment method from the following options.');
$this
->assertFieldByXPath("//input[@name='panes[payment][payment_method]' and @disabled='disabled']");
// Multiple payment methods.
variable_set('uc_payment_method_other_checkout', TRUE);
$this
->drupalGet('cart/checkout');
$this
->assertText('Select a payment method from the following options.');
$this
->assertNoFieldByXPath("//input[@name='panes[payment][payment_method]' and @disabled='disabled']");
}