public function FixedRatesTest::testLoadMultiple in Currency 8.3
@covers ::loadMultiple
File
- tests/
src/ Unit/ Plugin/ Currency/ ExchangeRateProvider/ FixedRatesTest.php, line 100
Class
- FixedRatesTest
- @coversDefaultClass \Drupal\currency\Plugin\Currency\ExchangeRateProvider\FixedRates
Namespace
Drupal\Tests\currency\Unit\Plugin\Currency\ExchangeRateProviderCode
public function testLoadMultiple() {
list($rates) = $this
->prepareExchangeRates();
$rates = array(
'EUR' => array(
'NLG' => $rates['EUR']['NLG'],
),
'NLG' => array(
'EUR' => $rates['NLG']['EUR'],
),
'ABC' => array(
'XXX' => NULL,
),
);
$returned_rates = $this->sut
->loadMultiple(array(
// Test a rate that is stored in config.
'EUR' => array(
'NLG',
),
// Test a reverse exchange rate.
'NLG' => array(
'EUR',
),
// Test an unavailable exchange rate.
'ABC' => array(
'XXX',
),
));
$this
->assertSame($rates['EUR']['NLG'], $returned_rates['EUR']['NLG']
->getRate());
$this
->assertSame($rates['NLG']['EUR'], $returned_rates['NLG']['EUR']
->getRate());
$this
->assertNull($returned_rates['ABC']['XXX']);
}