/**
  * {@inheritDoc}
  */
 public function getShippingMethods(ShoppingCart $shoppingCart, $address = null)
 {
     if (null == $address) {
         // now we just want the shipping method, but we need an address right now...
         $address = $shoppingCart->getShippingAddress();
     }
     $this->errors = array();
     ZenCartMock::startMock($shoppingCart, $address);
     // create new instance for each quote!
     // this is required as most modules do stuff in the c'tor (for example zone checks)
     $clazzName = get_class($this->zenModule);
     $module = new $clazzName();
     $quotes = $module->quote();
     // capture error(s)
     if (is_array($quotes) && array_key_exists('error', $quotes)) {
         $this->errors = array($quotes['error']);
         return array();
     }
     // capture tax
     $taxRate = Beans::getBean('ZenMagick\\StoreBundle\\Entity\\TaxRate');
     $taxRate->setRate(isset($quotes['tax']) ? $quotes['tax'] : 0);
     $methods = array();
     if (is_array($quotes) && array_key_exists('methods', $quotes)) {
         foreach ($quotes['methods'] as $method) {
             $shippingMethod = new ShippingMethodWrapper($this, $method);
             $shippingMethod->setProvider($this);
             $shippingMethod->setTaxRate($taxRate);
             $methods[$shippingMethod->getId()] = $shippingMethod;
         }
     }
     ZenCartMock::cleanupMock();
     return $methods;
 }