You are here

public function PriceTest::testSubtractWithMismatchedCurrencies in Commerce Core 8.2

Tests subtraction with mismatched currencies.

::covers subtract.

File

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

Class

PriceTest
Tests the Price class.

Namespace

Drupal\Tests\commerce_price\Unit

Code

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