/** * Test that the helper method ebayenterprise_order/factory::getNewSearchBuildRequest() * when invoked it will instantiate ebayenterprise_order/search_build_request object * passing in the an array with required key 'customer_id' to the constructor method. Finally, * the helper method ebayenterprise_order/factory::getNewSearchBuildRequest() will return * this instantiated object. */ public function testGetNewSearchBuildRequest() { /** @var string */ $customerId = '006512'; /** @var null */ $orderId = null; $api = $this->getMockBuilder(static::API_CLASS)->disableOriginalConstructor()->getMock(); /** @var EbayEnterprise_Order_Model_Search_Build_Request */ $searchBuildRequest = $this->getModelMock('ebayenterprise_order/search_build_request', [], false, [['api' => $api, 'customer_id' => $customerId, 'order_id' => $orderId]]); $this->replaceByMock('model', 'ebayenterprise_order/search_build_request', $searchBuildRequest); $this->assertSame($searchBuildRequest, $this->_factory->getNewSearchBuildRequest($api, $customerId, $orderId)); }
/** * Build order summary payload request and stash the * request to the class property self::$_request. * * @return self */ protected function _buildRequest() { $this->_request = $this->_factory->getNewSearchBuildRequest($this->_api, $this->_customerId, $this->_orderId)->build(); return $this; }