You are here

protected function CommerceFreeShippingTestProcess::enableFreeShipping in Commerce Free Shipping 7

Enable free shipping.

3 calls to CommerceFreeShippingTestProcess::enableFreeShipping()
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 82
Functional tests for the commerce free shipping module.

Class

CommerceFreeShippingTestProcess
Test checkout process.

Code

protected function enableFreeShipping() {
  $shipping_services = commerce_shipping_services();
  foreach ($shipping_services as $service) {

    // Enable free shipping for every service.
    $base = $service['base'];
    $this
      ->verbose($base . ' : enabling free shipping');
    variable_set($base . '_free_shipping_enabled', TRUE);
    variable_set($base . '_free_shipping_rate_limit', 6000);
    variable_set($base . '_free_shipping_gift_message', 'You have got free pricing on ' . $service['display_title'] . ', because your order total has raise %rate !');
    variable_set($base . '_free_shipping_reject_message', '%rate left to get free pricing on ' . $service['display_title']);
    variable_set($base . '_free_shipping_rules_reject_message', "You can get free shipping with " . $service['display_title'] . ", but you don't have enough {explain your conditions}.");
  }
}