本文整理汇总了PHP中oxTestModules::publicize方法的典型用法代码示例。如果您正苦于以下问题:PHP oxTestModules::publicize方法的具体用法?PHP oxTestModules::publicize怎么用?PHP oxTestModules::publicize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxTestModules
的用法示例。
在下文中一共展示了oxTestModules::publicize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPrepareUriFiltersRootFilesAndReservedKeywords
public function testPrepareUriFiltersRootFilesAndReservedKeywords()
{
oxTestModules::publicize('oxSeoEncoder', '_prepareUri');
oxTestModules::addFunction('oxSeoEncoder', '_trimUrl', '{return ltrim($aA[0], "u");}');
$oDb = modDB::getInstance();
$oDb->addClassFunction('GetOne', array($this, '__SaveToDbCreatesGoodMd5Callback'));
$iShopId = $this->getConfig()->getBaseShopId();
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('admin-oxid/aa.html', $oE->p_prepareUri('admin/aa.html'), '');
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('index-php/aa/', $oE->p_prepareUri('index.php/aa'), '');
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('index-php/', $oE->p_prepareUri('index.php'), '');
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('/index-oxid/aa.html', $oE->p_prepareUri('/index/aa.html'), '');
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('/index-php/aa.html', $oE->p_prepareUri('/index.php/aa.html'), '');
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('/index-oxid/', $oE->p_prepareUri('/index/'), '');
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('/index-oxid/', $oE->p_prepareUri('/index'), '');
$oE = oxNew('oxseoencoder');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('index-oxid/', $oE->p_prepareUri('--index'), '');
$oE = oxNew('oxseoencoder');
$oE->setSeparator('/');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('/index_oxid/aa.html', $oE->p_prepareUri('/index/aa.html'), '');
$cl = oxTestModules::addFunction('oxSeoEncoder', 'clean_aReservedEntryKeys', '{oxSeoEncoder::$_aReservedEntryKeys = null;}');
$oE = new $cl();
$oE->clean_aReservedEntryKeys();
$oE->setReservedWords(array('keyword1', 'keyword2'));
$oE->setSeparator('+');
$this->aSQL = array();
$this->aRET = array(false);
$this->assertEquals('/keyword1+oxid/keyword1+s+keyword2/aa+keyword1.html', $oE->p_prepareUri('/keyword1/keyword1-s.keyword2/aa-keyword1.html'), '');
$this->assertEquals('/keyword2+oxid/', $oE->p_prepareUri('/keyword2'), '');
}
示例2: testGetReviewList
/**
* Article_Review::_getReviewList() test case
*
* @return null
*/
public function testGetReviewList()
{
$articleVariantId = $this->getTestArticleVariantId();
oxDb::getDb()->execute('replace into oxreviews (OXID, OXACTIVE, OXOBJECTID, OXTYPE, OXTEXT, OXUSERID, OXCREATE, OXLANG, OXRATING)
values ("_test_i2", 1, "' . $articleVariantId . '", "oxarticle", "aa", "' . oxADMIN_LOGIN . '", "0000-00-00 00:00:00", "0", "3")');
oxTestModules::publicize('article_review', '_getReviewList');
$o = oxNew('article_review');
$oA = oxNew('oxArticle');
$oA->load($this->getTestArticleId());
$this->getConfig()->setConfigParam('blShowVariantReviews', false);
$this->assertEquals(1, count($o->p_getReviewList($oA)));
$this->getConfig()->setConfigParam('blShowVariantReviews', true);
$this->assertEquals(2, count($o->p_getReviewList($oA)));
}
示例3: testGetPictureInfoNotFound
public function testGetPictureInfoNotFound()
{
$oCfg = $this->getMock('oxConfig', array('getPicturePath', 'getOutDir', 'getOutUrl'));
$oCfg->expects($this->once())->method('getPicturePath')->will($this->returnValue(false));
$oCfg->expects($this->never())->method('getOutDir');
$oCfg->expects($this->never())->method('getOutUrl');
$cl = oxTestModules::publicize('oxPictureHandler', '_getPictureInfo');
$oPicHandler = $this->getMock($cl, array('getConfig'));
$oPicHandler->expects($this->any())->method('getConfig')->will($this->returnValue($oCfg));
$this->assertEquals(array('path' => false, 'url' => false), $oPicHandler->p_getPictureInfo('master/product/', 'nopic.jpg'));
}
示例4: testGetSearchParamsUrl
public function testGetSearchParamsUrl()
{
oxTestModules::addFunction('oxLang', 'getBaseLanguage', '{return 5;}');
oxTestModules::addFunction('oxLang', 'translateString', '{return $aA[0]."%s";}');
oxTestModules::publicize('oxrssfeed', '_getSearchParamsUrl');
$oRss = oxNew('oxRssFeed');
$this->assertEquals('searchparam=a+a', $oRss->p_getSearchParamsUrl('a a', '', '', ''));
$this->assertEquals('searchparam=+a&searchcnid=b+', $oRss->p_getSearchParamsUrl(' a', 'b ', '', ''));
$this->assertEquals('searchparam=+a&searchcnid=b+&searchvendor=+c', $oRss->p_getSearchParamsUrl(' a', 'b ', ' c', ''));
$this->assertEquals('searchparam=+a&searchvendor=+c', $oRss->p_getSearchParamsUrl(' a', '', ' c', ''));
$this->assertEquals('searchparam=+a&searchmanufacturer=+d+', $oRss->p_getSearchParamsUrl(' a', '', '', ' d '));
}
示例5: testUnserializeConfVar
/**
* _unserializeConfVar test
*
* @return null
*/
public function testUnserializeConfVar()
{
$sCl = oxTestModules::publicize('Shop_Config', '_unserializeConfVar');
$oTest = new $sCl();
$this->assertEquals('1.1', $oTest->p_unserializeConfVar('str', 'iMinOrderPrice', '1,1'));
$this->assertEquals('2,2', $oTest->p_unserializeConfVar('str', 'shouldNotChange', '2,2'));
}