You are here

function CurrencyExchangerWebTestCase::assertIdenticalCurrencyExchangeRates in Currency 7.2

Assert sthat exchange rates for identical currencies can be retrieved.

1 call to CurrencyExchangerWebTestCase::assertIdenticalCurrencyExchangeRates()
CurrencyExchangerWebTestCase::testCurrencyExchanger in currency/tests/CurrencyConverterWebTestCase.test
Test currency exchange.

File

currency/tests/CurrencyConverterWebTestCase.test, line 98
Contains class CurrencyExchangerWebTestCase.

Class

CurrencyExchangerWebTestCase
Tests CurrencyExchanger.

Code

function assertIdenticalCurrencyExchangeRates() {

  // Test CurrencyExchanger::load().
  $this
    ->assertIdentical(CurrencyExchanger::load('EUR', 'EUR'), '1');

  // Test CurrencyExchanger::loadMultiple().
  $rates = CurrencyExchanger::loadMultiple(array(
    'EUR' => array(
      'EUR',
    ),
  ));
  $this
    ->assertTrue(isset($rates['EUR']));
  $this
    ->assertTrue(isset($rates['EUR']['EUR']));
  $this
    ->assertIdentical($rates['EUR']['EUR'], '1');
}