You are here

public function PriceTest::testInvalidCurrencyCode in Commerce Core 8.2

Tests creating a price with an invalid currency code.

::covers __construct.

File

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

Class

PriceTest
Tests the Price class.

Namespace

Drupal\Tests\commerce_price\Unit

Code

public function testInvalidCurrencyCode() {
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('Invalid currency code "TEST".');
  $price = new Price('10', 'TEST');
}