示例#1
0
 /**
  * Returns product list containing searchable product or its parent and its variants
  *
  * @return oxlist
  */
 public function getProductList()
 {
     if ($this->_oSearchProductList === null) {
         $this->_oSearchProductList = oxNew("oxlist");
         // main search product is found?
         if ($oMainSearchProduct = $this->getMainProduct()) {
             // storing self to first list position
             $this->_oSearchProductList->offsetSet($oMainSearchProduct->getId(), $oMainSearchProduct);
             // adding variants..
             foreach ($oMainSearchProduct->getVariants() as $oVariant) {
                 $this->_oSearchProductList->offsetSet($oVariant->getId(), $oVariant);
             }
         }
     }
     return $this->_oSearchProductList;
 }
示例#2
0
 public function testaListCollectMetaKeyword()
 {
     $sValue = 'agentū Литовfür test best nest fest';
     $sResult = 'agentū литовfür test best nest fest';
     $oArt = oxNew('oxArticle');
     $oArt->setArticleLongDesc($sValue);
     $oArtList = new oxlist();
     $oArtList->offsetSet(0, $oArt);
     $oView = $this->getMock('alist', array('getArticleList', '_prepareMetaDescription', '_getCatPathString'));
     $oView->expects($this->once())->method('getArticleList')->will($this->returnValue($oArtList));
     $oView->expects($this->once())->method('_getCatPathString')->will($this->returnValue(''));
     $oView->expects($this->once())->method('_prepareMetaDescription')->with($this->equalTo($sResult), $this->equalTo(-1), $this->equalTo(false))->will($this->returnValue($sResult));
     $this->assertEquals('agentū, литовfür, test, best, nest, fest', $oView->UNITcollectMetaKeyword(array()));
 }