Example #1
0
 public function testCreate()
 {
     $shipmentTracker = $this->dummyData->getShipmentTracker();
     $shipment = new Shipment();
     $shipment->addShipmentTracker($shipmentTracker);
     $order = $this->dummyData->getOrder();
     $order->addShipment($shipment);
     $shipmentItem = $this->dummyData->getShipmentItem($shipment);
     $shipmentComment = $this->dummyData->getShipmentComment($shipment);
     $this->assertEntityValid($shipment);
     $this->assertSame($order, $shipment->getOrder());
     $this->assertSame($shipmentTracker, $shipment->getShipmentTrackers()[0]);
     $this->assertSame($shipmentItem, $shipment->getShipmentItems()[0]);
     $this->assertSame($shipmentComment, $shipment->getShipmentComments()[0]);
 }
 public function setShipment(Shipment $shipment)
 {
     $this->shipment = $shipment;
     $shipment->addShipmentTracker($this);
 }