You are here

public function ProposedShipmentTest::testGetItems in Commerce Shipping 8.2

@covers ::getItems

File

tests/src/Unit/ProposedShipmentTest.php, line 79

Class

ProposedShipmentTest
@coversDefaultClass \Drupal\commerce_shipping\ProposedShipment @group commerce_shipping

Namespace

Drupal\Tests\commerce_shipping\Unit

Code

public function testGetItems() {
  $expected_items = [];
  $expected_items[] = new ShipmentItem([
    'order_item_id' => 10,
    'title' => 'T-shirt (red, small)',
    'quantity' => 1,
    'weight' => new Weight('10', 'kg'),
    'declared_value' => new Price('10', 'USD'),
  ]);
  $items = $this->proposedShipment
    ->getItems();
  $this
    ->assertArrayEquals($expected_items, $items);
}