/**
  * Test the 'process' method is called by the observer
  */
 public function testAmqpMessageCreditIssuedObserverCallsProcess()
 {
     $factory = new Payload\PayloadFactory();
     $payload = $factory->buildPayload('\\eBayEnterprise\\RetailOrderManagement\\Payload\\OrderEvents\\OrderCreditIssued');
     $credit = $this->getModelMockBuilder('ebayenterprise_order/creditissued')->addMethod('process')->setConstructorArgs([['payload' => $payload]]);
     $credit->expects($this->once())->method('process')->willReturn($credit);
     $this->replaceByMock('model', 'ebayenterprise_order/creditissued', $credit);
     $eventObserver = $this->_buildEventObserver(['message' => '<OrderEvents/>']);
     $observer = Mage::getModel('ebayenterprise_order/observer');
     $observer->handleEbayEnterpriseAmqpMessageOrderCreditIssued($eventObserver);
 }
 public function setUp()
 {
     parent::setUp();
     $this->_payloadFactory = new PayloadFactory();
     $this->_payload = $this->_payloadFactory->buildPayload('\\eBayEnterprise\\RetailOrderManagement\\Payload\\OrderEvents\\OrderShipped');
     $this->_payload->deserialize(file_get_contents(__DIR__ . '/ShipmentTest/fixtures/OrderShipped.xml'));
     // suppressing the real session from starting
     $session = $this->getModelMockBuilder('core/session')->disableOriginalConstructor()->setMethods(null)->getMock();
     $this->replaceByMock('singleton', 'core/session', $session);
     $this->_shipmentHelper = Mage::helper('ebayenterprise_order/event_shipment');
 }
 public function setUp()
 {
     parent::setUp();
     $this->_payloadFactory = new PayloadFactory();
     $this->_payload = $this->_payloadFactory->buildPayload('\\eBayEnterprise\\RetailOrderManagement\\Payload\\OrderEvents\\OrderShipped');
     $this->_payload->setCustomerOrderId(static::PAYLOAD_CUSTOMER_ORDER_ID)->setStoreId(static::PAYLOAD_STORE_ID);
     // suppressing the real session from starting
     $session = $this->getModelMockBuilder('core/session')->disableOriginalConstructor()->setMethods(null)->getMock();
     $this->replaceByMock('singleton', 'core/session', $session);
     $this->_shipmentHelper = $this->getHelperMock('ebayenterprise_order/event_shipment', ['process']);
     $this->_ordershipped = Mage::getModel('ebayenterprise_order/ordershipped', ['payload' => $this->_payload, 'shipment_event_helper' => $this->_shipmentHelper]);
 }
 public function setUp()
 {
     parent::setUp();
     $this->_order = Mage::getModel('sales/order');
     $this->_item = Mage::getModel('sales/order_item');
     $this->_helperMock = $this->getHelperMock('eb2cgiftwrap/data');
     $this->_messageMock = $this->getModelMock('giftmessage/message', array('load'));
     $this->_giftwrappingMock = $this->getModelMock('enterprise_giftwrapping/wrapping', array('load'));
     $this->_payloadFactory = new PayloadFactory();
     // This payload will be the source of all sub-payloads handled. Any gifting
     // subpayloads to be tested should come from it.
     $this->_orderCreateRequest = $this->_payloadFactory->buildPayload('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Order\\OrderCreateRequest');
 }
 /**
  * Create a new OrderDetailRequest payload.
  *
  * @return IPayload
  */
 protected function createNewPayload()
 {
     return $this->payloadFactory->buildPayload('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Order\\Detail\\OrderDetailRequest', null, null, new NullLogger());
 }
 /**
  * Create a new order shipped payload.
  *
  * @return IPayload
  */
 protected function createNewPayload()
 {
     return $this->payloadFactory->buildPayload(self::PAYLOAD_CLASS, null, null, new NullLogger());
 }
 /**
  * Create a new order shipped payload.
  *
  * @return IPayload
  */
 protected function createNewPayload()
 {
     return $this->payloadFactory->buildPayload('\\eBayEnterprise\\RetailOrderManagement\\Payload\\OrderEvents\\OrderReturnInTransit', null, null, new NullLogger());
 }
 /**
  * Create a new OrderSummaryResponse payload.
  *
  * @return IPayload
  */
 protected function createNewPayload()
 {
     return $this->payloadFactory->buildPayload('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Customer\\OrderSummaryResponse', null, null, new NullLogger());
 }