コード例 #1
0
ファイル: ViewTest.php プロジェクト: natxetee/magento2
 /**
  * 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);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 /**
 * View product action
 */
 public function viewAction()
 {
     echo '���ǹ���....';
     parent::viewAction();
 }
コード例 #4
0
ファイル: ViewTest.php プロジェクト: relue/magento2
 /**
  * @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());
 }
コード例 #5
0
ファイル: ProductController.php プロジェクト: rajarshc/Rooja
 public function viewAction()
 {
     parent::viewAction();
 }
コード例 #6
0
 public function productoptionAction()
 {
     return parent::viewAction();
 }