示例#1
0
 /**
  * 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());
 }