function it_updates_orders_exchange_rate(RepositoryInterface $currencyRepository, OrderInterface $order, CurrencyInterface $currency) { $order->getCurrencyCode()->willReturn('USD'); $currency->getCode()->willReturn('USD'); $currency->getExchangeRate()->willReturn(2); $currencyRepository->findOneBy(['code' => 'USD'])->willReturn($currency); $order->setExchangeRate(2)->shouldBeCalled(); $this->update($order); }