/**
  * Test for Mage_Adminhtml_Catalog_ProductController::quickCreateAction
  */
 public function testQuickCreateActionWithDangerRequest()
 {
     $data = array('entity_id' => 234);
     $this->_request->expects($this->any())->method('getParam')->will($this->returnValue($data));
     $typeInstance = $this->getMockBuilder('Mage_Catalog_Model_Product_Type')->setMethods(array('getConfigurableAttributes', 'getEditableAttributes'))->getMock();
     $typeInstance->expects($this->any())->method('getEditableAttributes')->will($this->returnValue(array()));
     $typeInstance->expects($this->any())->method('getConfigurableAttributes')->will($this->returnValue(array()));
     $productMock = $this->getMockBuilder('Mage_Catalog_Model_Product')->setMethods(array('getIdFieldName', 'save', 'getSku', 'isConfigurable', 'setStoreId', 'load', 'setTypeId', 'setAttributeSetId', 'getAttributeSetId', 'getTypeInstance', 'getWebsiteIds'))->disableOriginalConstructor()->getMock();
     $productMock->expects($this->any())->method('getIdFieldName')->will($this->returnValue('entity_id'));
     $productMock->expects($this->any())->method('isConfigurable')->will($this->returnValue(true));
     $productMock->expects($this->any())->method('setStoreId')->will($this->returnSelf());
     $productMock->expects($this->any())->method('load')->will($this->returnSelf());
     $productMock->expects($this->any())->method('setTypeId')->will($this->returnSelf());
     $productMock->expects($this->any())->method('setAttributeSetId')->will($this->returnSelf());
     $productMock->expects($this->any())->method('getTypeInstance')->will($this->returnValue($typeInstance));
     $productMock->expects($this->never())->method('save');
     $this->_response->expects($this->once())->method('setBody')->with('{"attributes":[],"error":{"message":"Unable to create product"}}');
     $helper = $this->getMockBuilder('Mage_Core_Helper_Data')->setMethods(array('jsonEncode'))->getMock();
     $helper->expects($this->once())->method('jsonEncode')->with(array('attributes' => array(), 'error' => array('message' => 'Unable to create product', 'fields' => array('sku' => ''))))->will($this->returnValue('{"attributes":[],"error":{"message":"Unable to create product"}}'));
     $this->_objectManager->expects($this->any())->method('create')->with('Mage_Catalog_Model_Product', array(), true)->will($this->returnValue($productMock));
     $this->_objectManager->expects($this->any())->method('get')->with('Mage_Core_Helper_Data', array())->will($this->returnValue($helper));
     $this->_controller->quickCreateAction();
 }