public function ChargeTest::testInvalidFullBillingPeriod in Commerce Recurring Framework 8
@covers ::__construct
File
- tests/
src/ Kernel/ ChargeTest.php, line 91
Class
- ChargeTest
- @coversDefaultClass \Drupal\commerce_recurring\Charge @group commerce_recurring
Namespace
Drupal\Tests\commerce_recurring\KernelCode
public function testInvalidFullBillingPeriod() {
$this
->expectException(\InvalidArgumentException::class);
$this
->expectExceptionMessage('The "full_billing_period" property must be an instance of Drupal\\commerce_recurring\\BillingPeriod.');
$charge = new Charge([
'title' => 'My subscription',
'unit_price' => new Price('99.99', 'USD'),
'billing_period' => new BillingPeriod(DrupalDateTime::createFromFormat('Y-m-d', '2019-01-01'), DrupalDateTime::createFromFormat('Y-m-d', '2019-02-01')),
'full_billing_period' => 'INVALID',
]);
}