Exemplo n.º 1
0
 public function testGetUrlPath()
 {
     $product = new Mage_Catalog_Model_Product();
     $product->setUrlPath('product.html');
     $category = new Mage_Catalog_Model_Category();
     $category->setUrlPath('category.html');
     $this->assertEquals('product.html', $this->_model->getUrlPath($product));
     $this->assertEquals('category/product.html', $this->_model->getUrlPath($product, $category));
 }
Exemplo n.º 2
0
 public function testGetUrlPath()
 {
     /** @var $product Mage_Catalog_Model_Product */
     $product = Mage::getModel('Mage_Catalog_Model_Product');
     $product->setUrlPath('product.html');
     /** @var $category Mage_Catalog_Model_Category */
     $category = Mage::getModel('Mage_Catalog_Model_Category');
     $category->setUrlPath('category.html');
     $this->assertEquals('product.html', $this->_model->getUrlPath($product));
     $this->assertEquals('category/product.html', $this->_model->getUrlPath($product, $category));
 }
 /**
  * Retrieve Product Url Path (include category)
  *
  * @param Mage_Catalog_Model_Category $category
  * @return string
  */
 public function getUrlPath($category = null)
 {
     return $this->_urlModel->getUrlPath($this, $category);
 }