function PaymentCommerceCheckoutWebTestCase::testCheckoutFailed in Payment for Drupal Commerce 7
Same name and namespace in other branches
- 7.2 tests/PaymentCommerceCheckoutWebTestCase.test \PaymentCommerceCheckoutWebTestCase::testCheckoutFailed()
Tests the checkout process for a failed payment.
File
- tests/
PaymentCommerceCheckoutWebTestCase.test, line 72
Class
Code
function testCheckoutFailed() {
$status = PAYMENT_STATUS_FAILED;
// Create a payment method.
$payment_method = PaymentWebTestCase::paymentMethodCreate(0, payment_method_controller_load('PaymentMethodBasicController'));
$payment_method->controller_data['status'] = $status;
entity_save('payment_method', $payment_method);
drupal_static_reset();
drupal_flush_all_caches();
// Test an authenticated checkout.
$user = $this
->assertLogin();
$this
->assertCheckout($this->product->product_id, $this->loggedInUser->uid, $payment_method->pmid, $this->payment_method_unavailable->pmid);
$order_id = $this
->getLastOrderID();
$this
->assertUrl('checkout/' . $order_id . '/review');
$this
->assertPaymentExists($order_id, $status);
}