/** * Test that the helper method ebayenterprise_order/factory::getNewSearchSendRequest() * when invoked it will instantiate ebayenterprise_order/search_send_request object * and passing to its constructor method an array with required key 'request', mapped to an instance of * type IOrderSummaryRequest. Finally, the helper method ebayenterprise_order/factory::getNewSearchSendRequest() * will return the instance of type ebayenterprise_order/search_send_request. */ public function testGetNewSearchSendRequest() { /** @var Mock_IOrderSummaryRequest */ $request = $this->getMockBuilder(EbayEnterprise_Order_Model_Search_Build_IRequest::PAYLOAD_CLASS)->disableOriginalConstructor()->getMock(); $api = $this->getMockBuilder(static::API_CLASS)->disableOriginalConstructor()->getMock(); /** @var EbayEnterprise_Order_Model_Search_Send_Request */ $searchSendRequest = $this->getModelMock('ebayenterprise_order/search_send_request', [], false, [['api' => $api, 'request' => $request]]); $this->replaceByMock('model', 'ebayenterprise_order/search_send_request', $searchSendRequest); $this->assertSame($searchSendRequest, $this->_factory->getNewSearchSendRequest($api, $request)); }
/** * Send order summary payload request and stash the * return response to the class property self::$_response. * * @return self */ protected function _sendRequest() { $this->_response = $this->_factory->getNewSearchSendRequest($this->_api, $this->_request)->send(); return $this; }