protected function setUp() { $this->_helper = $this->getMock('StdClass', array('isPriceGlobal')); $this->_helper->expects($this->any())->method('isPriceGlobal')->will($this->returnValue(true)); $this->_model = $this->getMockForAbstractClass('Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract', array(array('helper' => $this->_helper))); $resource = $this->getMock('StdClass', array('getMainTable')); $resource->expects($this->any())->method('getMainTable')->will($this->returnValue('table')); $this->_model->expects($this->any())->method('_getResource')->will($this->returnValue($resource)); }
protected function setUp() { $mediaUploader = $this->getMockBuilder('Mage_Adminhtml_Block_Media_Uploader')->disableOriginalConstructor()->setMethods(array('getDataMaxSizeInBytes'))->getMock(); $mediaUploader->expects($this->once())->method('getDataMaxSizeInBytes')->will($this->returnValue('999')); $this->_url = $this->getMock('Mage_Backend_Model_Url', array('getUrl'), array(), '', false); $this->_url->expects($this->once())->method('getUrl')->will($this->returnValue('http://example.com/pub/images/catalog_product_gallery/upload/')); $jsonEncode = function ($value) { return json_encode($value); }; $this->_coreHelper = $this->getMockBuilder('Mage_Core_Helper_Data')->disableOriginalConstructor()->setMethods(array('escapeHtml', 'jsonEncode'))->getMock(); $this->_coreHelper->expects($this->any())->method('jsonEncode')->will($this->returnCallback($jsonEncode)); $this->_catalogHelperData = $this->getMockBuilder('Mage_Catalog_Helper_Data')->disableOriginalConstructor()->setMethods(array('__'))->getMock(); $this->_catalogHelperData->expects($this->any())->method('__')->will($this->returnCallback('json_encode')); $form = $this->getMockBuilder('Varien_Data_Form')->disableOriginalConstructor()->setMethods(null)->getMock(); $product = $this->getMockBuilder('Mage_Catalog_Model_Product')->disableOriginalConstructor()->setMethods(array('getMediaGalleryImages'))->getMock(); $form->setDataObject($product); $this->_block = new Mage_Adminhtml_Block_Catalog_Product_Helper_Form_BaseImage(array('name' => 'image', 'label' => 'Base Image', 'mediaUploader' => $mediaUploader, 'url' => $this->_url, 'coreHelper' => $this->_coreHelper, 'catalogHelperData' => $this->_catalogHelperData)); $this->_block->setForm($form); $this->_block->setHtmlId('image'); }
public function testGetPageTemplateProcessor() { $this->assertInstanceOf('Varien_Filter_Template', $this->_helper->getPageTemplateProcessor()); }
/** * Return statuses array * @return array */ public function toOptionArray() { return array('1' => $this->_helper->__('Yes'), '0' => $this->_helper->__('No')); }