You are here

public function CommerceExchangerCalculatorTest::testExchangerIdEmpty in Commerce Exchanger 8

@covers ::getExchangerId

File

tests/src/Kernel/CommerceExchangerCalculatorTest.php, line 107

Class

CommerceExchangerCalculatorTest
Tests the exchanger calculator.

Namespace

Drupal\Tests\commerce_exchanger\Kernel

Code

public function testExchangerIdEmpty() {
  $this->exchanger
    ->setStatus(FALSE);
  $this->exchanger
    ->save();
  $this
    ->assertEmpty($this->container
    ->get('commerce_exchanger.calculate')
    ->getExchangerId());
  $this
    ->assertEmpty($this->container
    ->get('commerce_exchanger.calculate')
    ->getExchangeRates());
  $this
    ->expectException(ExchangeRatesDataMismatchException::class);
  $this->container
    ->get('commerce_exchanger.calculate')
    ->priceConversion($this->priceUsd, 'HRK');
  $this
    ->expectException(ExchangeRatesDataMismatchException::class);
  $this->container
    ->get('commerce_exchanger.calculate')
    ->priceConversion($this->priceHrk, 'USD');
}