コード例 #1
0
 /**
  * Add fulfillment to feed
  *
  * @param OrderFulfillment $orderFulfillment
  *
  * @return OrderFulfillment
  */
 public function addFulfillment(OrderFulfillment $orderFulfillment)
 {
     $this->xml->startElement('Message');
     $this->xml->writeElement('MessageID', $this->messageCount);
     $this->xml->writeElement('OperationType', 'Update');
     $orderFulfillment->writeXml();
     $this->xml->endElement();
     $this->messageCount++;
     return $this;
 }
コード例 #2
0
 public function testOrderFulfillmentByCarrierName()
 {
     $xml = new \XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $f = new OrderFulfillment($xml);
     $f->setMerchantOrderId(123)->setCarrierName('UPS')->setFulfillmentDate(new \DateTime('2000-01-01T00:00:00-06:00'))->setMerchantFulfillmentId(123)->setShipperTrackingNumber('1Z0')->setShippingMethod('Ground');
     $f->writeXml();
     $dom = new \DOMDocument();
     $dom->loadXML($xml->outputMemory(true));
     $this->assertTrue($dom->schemaValidate(__DIR__ . '/../../../XSD/Fulfillment.xsd'));
 }