You are here

public function PriceTwigExtensionTest::testInvalidPrice in Commerce Core 8.2

Tests passing an invalid value.

File

modules/price/tests/src/Kernel/PriceTwigExtensionTest.php, line 25

Class

PriceTwigExtensionTest
Tests the price twig filter.

Namespace

Drupal\Tests\commerce_price\Kernel

Code

public function testInvalidPrice() {
  $theme = [
    '#theme' => 'commerce_price_test',
    '#price' => [
      // Invalid keys.
      'numb' => '9.99',
      'currency_co' => 'USD',
    ],
  ];
  $this
    ->expectException('InvalidArgumentException');
  $this
    ->render($theme);
}