public function AdjustmentTest::testValidAdjustmentConstruct in Commerce Core 8.2
Tests the constructor and definition checks.
@covers ::__construct
File
- modules/
order/ tests/ src/ Kernel/ AdjustmentTest.php, line 93
Class
- AdjustmentTest
- @coversDefaultClass \Drupal\commerce_order\Adjustment @group commerce
Namespace
Drupal\Tests\commerce_order\KernelCode
public function testValidAdjustmentConstruct() {
$definition = [
'type' => 'custom',
'label' => '10% off',
'amount' => new Price('-1.00', 'USD'),
'source_id' => '1',
];
$adjustment = new Adjustment($definition);
$this
->assertInstanceOf(Adjustment::class, $adjustment);
}