You are here

public function UPSShipmentTest::testShipFrom in Commerce UPS 8.3

Test ship from address.

@covers ::setShipFrom

File

tests/src/Unit/UPSShipmentTest.php, line 36

Class

UPSShipmentTest
Class UPSShipmentTest.

Namespace

Drupal\Tests\commerce_ups\Unit

Code

public function testShipFrom() {
  $api_shipment = $this->upsShipment
    ->getShipment($this
    ->mockShipment(), $this
    ->mockShippingMethod());
  $ship_from = $api_shipment
    ->getShipFrom()
    ->getAddress();
  $this
    ->assertEquals('1025 Brevard Rd', $ship_from
    ->getAddressLine1());
  $this
    ->assertEquals('Asheville', $ship_from
    ->getCity());
  $this
    ->assertEquals('NC', $ship_from
    ->getStateProvinceCode());
  $this
    ->assertEquals('28806', $ship_from
    ->getPostalCode());
  $this
    ->assertEquals('US', $ship_from
    ->getCountryCode());
}