/** * Test for _getSessionMessageModels * * @magentoDataFixture Mage/Catalog/_files/multiple_products.php * @magentoAppIsolation enabled * @covers Mage_Catalog_Helper_Product_View::_getSessionMessageModels */ public function testGetSessionMessageModels() { $expectedMessages = array('Mage_Catalog_Model_Session' => 'catalog message', 'Mage_Checkout_Model_Session' => 'checkout message'); // add messages foreach ($expectedMessages as $sessionModel => $messageText) { /** @var $session Mage_Core_Model_Session_Abstract */ $session = Mage::getSingleton($sessionModel); $session->addNotice($messageText); } // _getSessionMessageModels invokes inside prepareAndRender $this->_helper->prepareAndRender(10, $this->_controller); // assert messages $actualMessages = $this->_controller->getLayout()->getMessagesBlock()->getMessages(); $this->assertSameSize($expectedMessages, $actualMessages); sort($expectedMessages); /** @var $message Mage_Core_Model_Message_Notice */ foreach ($actualMessages as $key => $message) { $actualMessages[$key] = $message->getText(); } sort($actualMessages); $this->assertEquals($expectedMessages, $actualMessages); }
public function addActionLayoutHandles() { if ($this->getRequest()->getRequestedActionName() == 'loadOptions' || $this->getRequest()->getRequestedActionName() == 'loadAllProductsOptions') { $update = $this->getLayout()->getUpdate(); $update->addHandle('STORE_' . Mage::app()->getStore()->getCode()); $package = Mage::getSingleton('core/design_package'); $update->addHandle('THEME_' . $package->getArea() . '_' . $package->getPackageName() . '_' . $package->getTheme('layout')); $update->addHandle('catalog_product_view'); } else { parent::addActionLayoutHandles(); } return $this; }
/** * View product action */ public function viewAction() { echo '���ǹ���....'; parent::viewAction(); }
/** * @magentoDataFixture Mage/Catalog/_files/two_products.php * @magentoAppIsolation enabled */ public function testPrepareAndRender() { $this->_helper->prepareAndRender(10, $this->_controller); $this->assertNotEmpty($this->_controller->getResponse()->getBody()); $this->assertEquals(10, Mage::getSingleton('Mage_Catalog_Model_Session')->getLastViewedProductId()); }
public function viewAction() { parent::viewAction(); }
public function productoptionAction() { return parent::viewAction(); }