You are here

public function ShipmentAddressTest::testIncompleteShipment in Commerce Shipping 8.2

::covers evaluate.

File

tests/src/Unit/Plugin/Commerce/Condition/ShipmentAddressTest.php, line 21

Class

ShipmentAddressTest
@coversDefaultClass \Drupal\commerce_shipping\Plugin\Commerce\Condition\ShipmentAddress @group commerce

Namespace

Drupal\Tests\commerce_shipping\Unit\Plugin\Commerce\Condition

Code

public function testIncompleteShipment() {
  $condition = new ShipmentAddress([
    'zone' => [
      'territories' => [
        [
          'country_code' => 'US',
          'administrative_area' => 'CA',
        ],
      ],
    ],
  ], 'shipment_address', [
    'entity_type' => 'commerce_shipment',
  ]);
  $shipment = $this
    ->prophesize(ShipmentInterface::class);
  $shipment
    ->getEntityTypeId()
    ->willReturn('commerce_shipment');
  $shipment
    ->getShippingProfile()
    ->willReturn(NULL);
  $shipment = $shipment
    ->reveal();
  $this
    ->assertFalse($condition
    ->evaluate($shipment));
}