You are here

protected function CommerceFreeShippingTestProcess::createFlateRateService in Commerce Free Shipping 7

Helper function to prepare flat rate service

3 calls to CommerceFreeShippingTestProcess::createFlateRateService()
CommerceFreeShippingTestProcess::testCommerceFreeShippingCheckoutAuthenticatedUser in tests/commerce_free_shipping.test
Test the checkout process using an authenticated user and basic free shipping configuration.
CommerceFreeShippingTestProcess::testCommerceFreeShippingWithFailingRulesConditionsCheckoutAuthenticatedUser in tests/commerce_free_shipping.test
Test the checkout process with a rules condition for free shipping that failed using an authenticated user.
CommerceFreeShippingTestProcess::testCommerceFreeShippingWithValidRulesConditionsCheckoutAuthenticatedUser in tests/commerce_free_shipping.test
Test the checkout process with a rules condition for free shipping that succeed using an authenticated user.

File

tests/commerce_free_shipping.test, line 68
Functional tests for the commerce free shipping module.

Class

CommerceFreeShippingTestProcess
Test checkout process.

Code

protected function createFlateRateService($name = 'shipping_service_test', $title = '', $amount = 700) {
  $flat_rate_service = commerce_flat_rate_service_new();
  $flat_rate_service['name'] = $name;
  $flat_rate_service['title'] = empty($title) ? t('Delivery service') : $title;
  $flat_rate_service['base_rate']['amount'] = $amount;
  commerce_flat_rate_service_save($flat_rate_service);
  return $flat_rate_service;
}