You are here

public function ChargeTest::testMissingProperty in Commerce Recurring Framework 8

@covers ::__construct

File

tests/src/Kernel/ChargeTest.php, line 21

Class

ChargeTest
@coversDefaultClass \Drupal\commerce_recurring\Charge @group commerce_recurring

Namespace

Drupal\Tests\commerce_recurring\Kernel

Code

public function testMissingProperty() {
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('Missing required property "billing_period".');
  $charge = new Charge([
    'title' => 'My subscription',
    'unit_price' => new Price('99.99', 'USD'),
  ]);
}