Ejemplo n.º 1
0
 public function testSetForm()
 {
     $this->_virtual = new Varien_Object();
     $helper = $this->getMock('Mage_Catalog_Helper_Product', array('getTypeSwitcherControlLabel'));
     $helper->expects($this->any())->method('getTypeSwitcherControlLabel')->will($this->returnValue('Virtual / Downloadable'));
     $this->assertNull($this->_virtual->getId());
     $this->assertNull($this->_virtual->getName());
     $this->assertNull($this->_virtual->getLabel());
     $this->assertNull($this->_virtual->getForm());
     $this->_model = new Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight_Renderer(array('element' => $this->_virtual, 'helper' => $helper));
     $form = new Varien_Data_Form();
     $this->_model->setForm($form);
     $this->assertEquals(Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight_Renderer::VIRTUAL_FIELD_HTML_ID, $this->_virtual->getId());
     $this->assertEquals('is_virtual', $this->_virtual->getName());
     $this->assertEquals('Virtual / Downloadable', $this->_virtual->getLabel());
     $this->assertSame($form, $this->_virtual->getForm());
 }