You are here

function PaymentCommerceCheckoutWebTestCase::getLastOrderID in Payment for Drupal Commerce 7.2

Same name and namespace in other branches
  1. 7 tests/PaymentCommerceCheckoutWebTestCase.test \PaymentCommerceCheckoutWebTestCase::getLastOrderID()

Loads the order ID of the most recent order.

Return value

integer

3 calls to PaymentCommerceCheckoutWebTestCase::getLastOrderID()
PaymentCommerceCheckoutWebTestCase::assertCheckout in tests/PaymentCommerceCheckoutWebTestCase.test
Executes the checkout process.
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 96

Class

PaymentCommerceCheckoutWebTestCase

Code

function getLastOrderID() {
  return db_select('commerce_order')
    ->fields('commerce_order', array(
    'order_id',
  ))
    ->orderBy('order_id', 'DESC')
    ->range(0, 1)
    ->execute()
    ->fetchField();
}