public function PriceTest::testCreateFromInvalidArray in Commerce Core 8.2
Tests creating a price from an invalid array.
::covers __construct.
File
- modules/
price/ tests/ src/ Unit/ PriceTest.php, line 37
Class
- PriceTest
- Tests the Price class.
Namespace
Drupal\Tests\commerce_price\UnitCode
public function testCreateFromInvalidArray() {
$this
->expectException(\InvalidArgumentException::class);
$this
->expectExceptionMessage('Price::fromArray() called with a malformed array.');
$price = Price::fromArray([]);
}