function PaymentCommerceCheckoutWebTestCase::assertPaymentExists in Payment for Drupal Commerce 7
Same name and namespace in other branches
- 7.2 tests/PaymentCommerceCheckoutWebTestCase.test \PaymentCommerceCheckoutWebTestCase::assertPaymentExists()
Tests that a payment exists.
Parameters
int $order_id:
string $status:
2 calls to PaymentCommerceCheckoutWebTestCase::assertPaymentExists()
- PaymentCommerceCheckoutWebTestCase::testCheckoutFailed in tests/
PaymentCommerceCheckoutWebTestCase.test - Tests the checkout process for a failed payment.
- PaymentCommerceCheckoutWebTestCase::testCheckoutSuccess in tests/
PaymentCommerceCheckoutWebTestCase.test - Tests the checkout process for a successful payment.
File
- tests/
PaymentCommerceCheckoutWebTestCase.test, line 181
Class
Code
function assertPaymentExists($order_id, $status) {
$pids = payment_commerce_pids_load($order_id);
if ($this
->assertTrue($pids)) {
$this
->assertTrue(count($pids), 1);
$pid = reset($pids);
$payment = entity_load_single('payment', $pid);
$this
->assertEqual($payment
->getStatus()->status, $status);
}
}