You are here

public function PriceTest::testAddWithMismatchedCurrencies in Commerce Core 8.2

Tests addition with mismatched currencies.

::covers add.

File

modules/price/tests/src/Unit/PriceTest.php, line 97

Class

PriceTest
Tests the Price class.

Namespace

Drupal\Tests\commerce_price\Unit

Code

public function testAddWithMismatchedCurrencies() {
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('The provided prices have mismatched currencies: 10 USD, 5 EUR.');
  $this->price
    ->add(new Price('5', 'EUR'));
}