From fdb887e43ac12e3d0327d199618a3c41950c3022 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 19 Feb 2021 14:18:32 +0200 Subject: [PATCH] fix test --- .../CurrencyConfigDataProviderTest.php | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/unit/Espo/Core/FieldUtils/Currency/CurrencyConfigDataProviderTest.php b/tests/unit/Espo/Core/FieldUtils/Currency/CurrencyConfigDataProviderTest.php index ac866ebcaa..b51874a522 100644 --- a/tests/unit/Espo/Core/FieldUtils/Currency/CurrencyConfigDataProviderTest.php +++ b/tests/unit/Espo/Core/FieldUtils/Currency/CurrencyConfigDataProviderTest.php @@ -98,18 +98,18 @@ class CurrencyConfigDataProviderTest extends \PHPUnit\Framework\TestCase public function testCurrencyRate1() { $this->config - ->expects($this->at(0)) + ->expects($this->exactly(2)) ->method('get') - ->with('currencyRates') - ->willReturn([ - 'EUR' => 1.2, - ]); - - $this->config - ->expects($this->at(1)) - ->method('get') - ->with('currencyList') - ->willReturn(['USD', 'EUR']); + ->withConsecutive( + ['currencyRates'], + ['currencyList'], + ) + ->willReturnOnConsecutiveCalls( + [ + 'EUR' => 1.2, + ], + ['USD', 'EUR'], + ); $result = $this->provider->getCurrencyRate('EUR'); @@ -119,18 +119,18 @@ class CurrencyConfigDataProviderTest extends \PHPUnit\Framework\TestCase public function testCurrencyRate2() { $this->config - ->expects($this->at(0)) + ->expects($this->exactly(2)) ->method('get') - ->with('currencyRates') - ->willReturn([ - 'EUR' => 1.2, - ]); - - $this->config - ->expects($this->at(1)) - ->method('get') - ->with('currencyList') - ->willReturn(['USD', 'EUR']); + ->withConsecutive( + ['currencyRates'], + ['currencyList'], + ) + ->willReturnOnConsecutiveCalls( + [ + 'EUR' => 1.2, + ], + ['USD', 'EUR'], + ); $result = $this->provider->getCurrencyRate('USD');