function it_uses_every_nested_handler_to_handle_the_currency_change(CurrencyChangeHandlerInterface $firstCurrencyChangeHandler, CurrencyChangeHandlerInterface $secondCurrencyChangeHandler)
 {
     $firstCurrencyChangeHandler->handle('USD')->shouldBeCalled();
     $secondCurrencyChangeHandler->handle('USD')->shouldBeCalled();
     $this->addHandler($firstCurrencyChangeHandler);
     $this->addHandler($secondCurrencyChangeHandler);
     $this->handle('USD');
 }
 /**
  * @param Request $request
  * @param string $code
  *
  * @return Response
  */
 public function switchAction(Request $request, $code)
 {
     if (!in_array($code, $this->currencyProvider->getAvailableCurrenciesCodes())) {
         throw new HttpException(Response::HTTP_NOT_ACCEPTABLE, sprintf('The currency code "%s" is invalid.', $code));
     }
     $this->currencyChangeHandler->handle($code);
     return new RedirectResponse($request->headers->get('referer', $request->getSchemeAndHttpHost()));
 }