You are here

function ucRecurringTestCase::placeOrderWithRecurringFee in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 uc_recurring.test \ucRecurringTestCase::placeOrderWithRecurringFee()

place an order for a product with a recurring fee.

3 calls to ucRecurringTestCase::placeOrderWithRecurringFee()
ucRecurringAPITestCase::testRecurringAdminFunctions in ./uc_recurring.test
Test administrator functions.
ucRecurringAPITestCase::testRecurringOrders in ./uc_recurring.test
Test customer functions of purchasing an order with recurring product.
ucRecurringIntegrationTestCase::testRecurringPaymentIntegration in ./uc_recurring.test
place an order with the mock gateway payment module

File

./uc_recurring.test, line 77
UC Recurring simpletest

Class

ucRecurringTestCase
@file UC Recurring simpletest

Code

function placeOrderWithRecurringFee($product) {
  $last_order_id = $this
    ->lastCreatedOrderId();

  // create an order
  $this
    ->drupalPost('node/' . $product->nid, array(), t('Add to cart'));
  $this
    ->assertRaw($product->title, t('The product name has been displayed on the cart page.'));
  $this
    ->assertRaw('added to', t('The product name has been displayed on the cart page.'));
  $this
    ->checkout(array(
    'panes[delivery][delivery_postal_code]' => '12345',
    'panes[billing][billing_postal_code]' => '12345',
  ));
  $this
    ->assertRaw('Your order is complete!', t('"Your order is complete!" appears on the thank you page.'));
  $order_id = $this
    ->lastCreatedOrderId();
  if ($order_id > $last_order_id) {
    return $order_id;
  }
  return FALSE;
}