You are here

public function CommerceMigrateTestTrait::assertAdjustment in Commerce Migrate 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertAdjustment()
  2. 3.1.x tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertAdjustment()

Assert an adjustment.

Parameters

\Drupal\commerce_order\Adjustment $expected: The expected adjustment.

\Drupal\commerce_order\Adjustment $actual: The actual adjustment.

1 call to CommerceMigrateTestTrait::assertAdjustment()
CommerceMigrateTestTrait::assertAdjustments in tests/src/Kernel/CommerceMigrateTestTrait.php
Assert multiple adjustments.

File

tests/src/Kernel/CommerceMigrateTestTrait.php, line 134

Class

CommerceMigrateTestTrait
Helper function to test migrations.

Namespace

Drupal\Tests\commerce_migrate\Kernel

Code

public function assertAdjustment(Adjustment $expected, Adjustment $actual) {
  $this
    ->assertSame($expected
    ->getLabel(), $actual
    ->getLabel());
  $this
    ->assertSame($expected
    ->getPercentage(), $actual
    ->getPercentage());
  $this
    ->assertSame($expected
    ->getSourceId(), $actual
    ->getSourceId());
  $this
    ->assertSame($expected
    ->getType(), $actual
    ->getType());
  $this
    ->assertPrice($expected
    ->getAmount(), $actual
    ->getAmount());
}