Exemplo n.º 1
0
 public function testInitProductLayout()
 {
     $uniqid = uniqid();
     $product = new Mage_Catalog_Model_Product();
     $product->setTypeId(Mage_Catalog_Model_Product_Type::DEFAULT_TYPE)->setId(99)->setUrlKey($uniqid);
     $this->_helper->initProductLayout($product, $this->_controller);
     $rootBlock = $this->_controller->getLayout()->getBlock('root');
     $this->assertInstanceOf('Mage_Page_Block_Html', $rootBlock);
     $this->assertContains("product-{$uniqid}", $rootBlock->getBodyClass());
     $handles = $this->_controller->getLayout()->getUpdate()->getHandles();
     $this->arrayHasKey('PRODUCT_99', $handles);
     $this->arrayHasKey('PRODUCT_TYPE_simple', $handles);
 }
Exemplo n.º 2
0
 /**
  * @magentoAppIsolation enabled
  */
 public function testInitProductLayout()
 {
     $uniqid = uniqid();
     /** @var $product Mage_Catalog_Model_Product */
     $product = Mage::getModel('Mage_Catalog_Model_Product');
     $product->setTypeId(Mage_Catalog_Model_Product_Type::DEFAULT_TYPE)->setId(99)->setUrlKey($uniqid);
     Mage::register('product', $product);
     $this->_helper->initProductLayout($product, $this->_controller);
     $rootBlock = $this->_controller->getLayout()->getBlock('root');
     $this->assertInstanceOf('Mage_Page_Block_Html', $rootBlock);
     $this->assertContains("product-{$uniqid}", $rootBlock->getBodyClass());
     $handles = $this->_controller->getLayout()->getUpdate()->getHandles();
     $this->assertContains('catalog_product_view_type_simple', $handles);
 }