You are here

public function ExchangerProviderPluginTest::testImportEnterprise in Commerce Exchanger 8

Test enterprise import.

::@covers ::import ::@covers ::buildExchangeRates ::@covers ::mapExchangeRates ::@covers ::processRemoteData ::@covers ::importEnterprise

File

tests/src/Kernel/ExchangerProviderPluginTest.php, line 116

Class

ExchangerProviderPluginTest
@coversDefaultClass \Drupal\commerce_exchanger\Plugin\Commerce\ExchangerProvider\ExchangerProviderRemoteBase @group commerce_exchanger

Namespace

Drupal\Tests\commerce_exchanger\Kernel

Code

public function testImportEnterprise() {

  // We need to disable test which is loaded first in default calculator.
  $test = ExchangeRates::load('test');
  $test
    ->set('status', 0)
    ->save();

  // Import rates.
  $this->enterprise
    ->import();
  $rates = $this->container
    ->get('commerce_exchanger.calculate')
    ->getExchangeRates();
  $this
    ->assertEqual(0.13, $rates['HRK']['EUR']['value']);
  $this
    ->assertEqual(7.58, $rates['EUR']['HRK']['value']);
}