/** * Test for getRequestedAttributes() method */ public function testGetRequestedAttributes() { $_GET[Mage_Webapi_Controller_Request::QUERY_PARAM_REQ_ATTRS][] = 'attr1'; $_GET[Mage_Webapi_Controller_Request::QUERY_PARAM_REQ_ATTRS][] = 'attr2'; $this->assertInternalType('array', $this->_request->getRequestedAttributes()); $this->assertEquals(array('attr1', 'attr2'), $this->_request->getRequestedAttributes()); $_GET[Mage_Webapi_Controller_Request::QUERY_PARAM_REQ_ATTRS] = 'attr1, attr2'; $this->assertInternalType('array', $this->_request->getRequestedAttributes()); $this->assertEquals(array('attr1', 'attr2'), $this->_request->getRequestedAttributes()); }
/** * Matches a Request with parts defined by a map. Assigns and * returns an array of variables on a successful match. * * @param Mage_Webapi_Controller_Request $request * @param boolean $partial Partial path matching * @return array|bool An array of assigned values or a boolean false on a mismatch */ public function match($request, $partial = false) { return parent::match(ltrim($request->getPathInfo(), $this->_urlDelimiter), $partial); }
/** * Initialize dependencies. * * @param Mage_Webapi_Helper_Data $helper * @param string|null $uri */ public function __construct(Mage_Webapi_Helper_Data $helper, $uri = null) { parent::__construct(Mage_Webapi_Controller_Front::API_TYPE_SOAP, $uri); $this->_helper = $helper; }