本文整理汇总了PHP中oxTestModules类的典型用法代码示例。如果您正苦于以下问题:PHP oxTestModules类的具体用法?PHP oxTestModules怎么用?PHP oxTestModules使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了oxTestModules类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testExecute
/**
* Test case for oxMaintenance::execute()
*
* @return null
*/
public function testExecute()
{
$oList = $this->getMock('oxArticleList', array('updateUpcomingPrices'));
$oList->expects($this->once())->method('updateUpcomingPrices')->with($this->equalTo(true));
oxTestModules::addModuleObject('oxarticlelist', $oList);
$oMaintenance = oxNew("oxMaintenance");
$oMaintenance->execute();
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:13,代码来源:oxmaintenanceTest.php
示例2: testRender
/**
* sysreq::Render() test case
*
* @return null
*/
public function testRender()
{
oxTestModules::addFunction('oxUtils', 'showMessageAndExit', '{ return "Access denied !"; }');
oxTestModules::addFunction('oxuser', 'loadAdminUser', '{ $this->oxuser__oxrights = new oxField( "justadmin" ); }');
// testing..
$oView = oxNew('systeminfo');
$this->assertEquals("Access denied !", $oView->render());
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:13,代码来源:systeminfoTest.php
示例3: setUp
/**
* Initialize the fixture.
*
* @return null
*/
protected function setUp()
{
parent::setUp();
$this->getConfig();
$this->getSession();
oxTestModules::addFunction('oxutils', 'setseoact', '{oxRegistry::getUtils()->_blSeoIsActive = $aA[0];}');
oxNew('oxutils')->setseoact(false);
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:13,代码来源:oxcmpLangTest.php
示例4: testGetModulesAnalizeTwo
/**
* @covers Helper_Modules::_getModulesAnalize
*/
public function testGetModulesAnalizeTwo()
{
modConfig::setParameter("start", true);
oxTestModules::addFunction('moduleManager', 'getModuleContentClass', '{ return true; }');
oxTestModules::addFunction('moduleManagerAnalize', 'setAnalize', '{ return true; }');
$oTestObj = $this->getProxyClass('Helper_Modules');
$this->assertNull($oTestObj->UNITgetModulesAnalize());
}
开发者ID:OXIDprojects,项目名称:debugax,代码行数:11,代码来源:helper_modulesTest.php
示例5: testGetCardList
/**
* Testing Wrapping::getCardList()
*
* @return null
*/
public function testGetCardList()
{
oxTestModules::addFunction('oxwrapping', 'getWrappingList', '{ return "getCardList"; }');
$oViewConfig = $this->getMock("oxViewConfig", array("getShowGiftWrapping"));
$oViewConfig->expects($this->once())->method('getShowGiftWrapping')->will($this->returnValue(true));
$oView = $this->getMock("Wrapping", array("getViewConfig"), array(), '', false);
$oView->expects($this->once())->method('getViewConfig')->will($this->returnValue($oViewConfig));
$this->assertEquals("getCardList", $oView->getCardList());
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:14,代码来源:wrappingTest.php
示例6: testRender
/**
* Article_Userdef::Render() test case
*
* @return null
*/
public function testRender()
{
$this->setRequestParameter("oxid", "testId");
oxTestModules::addFunction('oxarticle', 'isDerived', '{ return true; }');
// testing..
$oView = oxNew('Article_Userdef');
$this->assertEquals('article_userdef.tpl', $oView->render());
$this->assertTrue($oView->getViewDataElement('readonly'));
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:14,代码来源:articleuserdefTest.php
示例7: testConfirmRegistration
/**
* oxScLoginRegister::confirmRegistration() test case
*
* @return null
*/
public function testConfirmRegistration()
{
oxTestModules::addFunction("oxuser", "loadUserByUpdateId", "{return true;}");
oxTestModules::addFunction("oxuser", "setUpdateKey", "{return true;}");
oxTestModules::addFunction("oxuser", "save", "{return true;}");
$oView = $this->getMock("register", array("getUpdateId"));
$oView->expects($this->once())->method('getUpdateId')->will($this->returnValue("testUpdateId"));
$this->assertEquals('register?confirmstate=1', $oView->confirmRegistration());
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:14,代码来源:registerTest.php
示例8: testGetCompareItemsInJson
/**
* Testing oxwServiceMenu::getCompareItems()
*
* @return null
*/
public function testGetCompareItemsInJson()
{
$aItems = array("testId1" => "testVal1", "testId2" => "testVal2", "testId3" => "testVal3");
$aResult = '{"testId1":"testVal1","testId2":"testVal2","testId3":"testVal3"}';
$oCompare = $this->getMock("compare", array("getCompareItems"));
$oCompare->expects($this->once())->method("getCompareItems")->will($this->returnValue($aItems));
oxTestModules::addModuleObject('compare', $oCompare);
$oServiceMenu = oxNew('oxwServiceMenu');
$this->assertEquals($aResult, $oServiceMenu->getCompareItems(true));
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:15,代码来源:oxwservicemenuTest.php
示例9: testGetSimilarRecommLists
/**
* Testing oxwRecomm::getSimilarRecommLists()
*
* @return null
*/
public function testGetSimilarRecommLists()
{
$oRecommList = $this->getMock("oxrecommlist", array("getRecommListsByIds"));
$oRecommList->expects($this->once())->method("getRecommListsByIds")->with($this->equalTo(array("articleId")))->will($this->returnValue("oxRecommListMock"));
oxTestModules::addModuleObject('oxrecommlist', $oRecommList);
$aParams["aArticleIds"] = array("articleId");
$oRecomm = oxNew('oxwRecommendation');
$oRecomm->setViewParameters($aParams);
$this->assertEquals("oxRecommListMock", $oRecomm->getSimilarRecommLists(), "Should try to create RecommList object.");
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:15,代码来源:oxwrecommendationTest.php
示例10: testDelAddress
/**
* User_Address::DelAddress() test case
*
* @return null
*/
public function testDelAddress()
{
oxTestModules::addFunction('oxaddress', 'delete', '{ return true; }');
$this->setRequestParameter("oxid", "testId");
$this->setRequestParameter("editval", array("oxaddress__oxid" => "testOxId"));
// testing..
$oView = $this->getMock("User_Address", array("_allowAdminEdit"));
$oView->expects($this->at(0))->method('_allowAdminEdit')->with($this->equalTo("testId"))->will($this->returnValue(true));
$oView->delAddress();
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:15,代码来源:useraddressTest.php
示例11: testRender
/**
* Lets run the render method.
*/
public function testRender()
{
oxTestModules::addFunction('oxUtils', 'redirect', '{throw new Exception("REDIRECT");}');
$oView = new bz_barzahlen_thankyou();
try {
$oView->render();
} catch (Exception $e) {
$this->assertEquals("REDIRECT", $e->getMessage());
}
}
开发者ID:alexschwarz89,项目名称:Barzahlen-OXID-4.7,代码行数:13,代码来源:BarzahlenThankyouTest.php
示例12: testSave
/**
* Manufacturer_Seo::Save() test case
*
* @return null
*/
public function testSave()
{
oxTestModules::addFunction('oxbase', 'load', '{ return true; }');
oxTestModules::addFunction('oxbase', 'save', '{ return true; }');
$this->setRequestParameter("oxid", "testId");
// testing..
$oView = $this->getMock("Manufacturer_Seo", array("getEditObjectId"));
$oView->expects($this->atLeastOnce())->method('getEditObjectId')->will($this->returnValue(123));
$this->assertNull($oView->save());
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:15,代码来源:manufacturerseoTest.php
示例13: testGetContentLoadByIdentLangChange
public function testGetContentLoadByIdentLangChange()
{
$sShopId = $this->getTestConfig()->getShopEdition() == 'EE' ? '1' : 'oxbaseshop';
$aParams['ident'] = 'oxsecurityinfo';
$oSmarty = $this->getMock("smarty", array("fetch"));
$oSmarty->expects($this->once())->method('fetch')->with($this->equalTo('ox:oxsecurityinfooxcontent1' . $sShopId))->will($this->returnValue('testvalue'));
$message = "Content not found! check ident(" . $aParams['ident'] . ") !";
oxTestModules::addFunction('oxLang', 'getBaseLanguage', '{return 1;}');
$this->assertEquals('testvalue', smarty_function_oxcontent($aParams, $oSmarty), $message);
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:10,代码来源:pluginsmartyoxcontentTest.php
示例14: testRenderDemoshop
/**
* Tools::Render() test case
*
* @return null
*/
public function testRenderDemoshop()
{
oxTestModules::addFunction('oxUtils', 'showMessageAndExit', '{ return "Access denied !"; }');
$oConfig = $this->getMock("oxConfig", array("isDemoShop"));
$oConfig->expects($this->once())->method('isDemoShop')->will($this->returnValue(true));
// testing..
$oView = $this->getMock("Tools", array("getConfig"), array(), '', false);
$oView->expects($this->once())->method('getConfig')->will($this->returnValue($oConfig));
$this->assertEquals("Access denied !", $oView->render());
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:15,代码来源:toolsTest.php
示例15: testRender
/**
* DeliverySet_Users::Render() test case
*
* @return null
*/
public function testRender()
{
oxTestModules::addFunction("oxdeliveryset", "isDerived", "{return true;}");
$this->setRequestParameter("oxid", "testId");
// testing..
$oView = oxNew('DeliverySet_Users');
$this->assertEquals('deliveryset_users.tpl', $oView->render());
$aViewData = $oView->getViewData();
$this->assertTrue(isset($aViewData['readonly']));
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:15,代码来源:deliverysetusersTest.php
示例16: testInit
/**
* Attribute_List::Init() test case
*
* @return null
*/
public function testInit()
{
oxTestModules::addFunction("oxUtilsServer", "getOxCookie", "{return array(1);}");
oxTestModules::addFunction("oxUtils", "checkAccessRights", "{return true;}");
$oSess = $this->getMock('oxsession', array('checkSessionChallenge'));
$oSess->expects($this->any())->method('checkSessionChallenge')->will($this->returnValue(true));
$oView = $this->getMock($this->getProxyClassName('Attribute_List'), array('getSession'));
$oView->expects($this->any())->method('getSession')->will($this->returnValue($oSess));
$oView->init();
$this->assertEquals("oxattribute", $oView->getNonPublicVar("_sListClass"));
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:16,代码来源:attributelistTest.php
示例17: testPageClose
public function testPageClose()
{
$oSession = $this->getMock('oxSession', array('freeze'));
$oSession->expects($this->once())->method('freeze')->will($this->returnValue(null));
$oStart = $this->getMock('oxStart', array('getSession'));
$oStart->expects($this->once())->method('getSession')->will($this->returnValue($oSession));
$oUtils = $this->getMock('oxUtils', array('commitFileCache'));
$oUtils->expects($this->once())->method('commitFileCache')->will($this->returnValue(null));
oxTestModules::addModuleObject('oxUtils', $oUtils);
$this->assertEquals(null, $oStart->pageClose());
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:11,代码来源:oxstartTest.php
示例18: testInit
/**
* Category_List::Init() test case
*
* @return null
*/
public function testInit()
{
oxTestModules::addFunction("oxUtilsServer", "getOxCookie", "{return array(1);}");
oxTestModules::addFunction("oxUtils", "checkAccessRights", "{return true;}");
$oSess = $this->getMock('oxsession', array('checkSessionChallenge'));
$oSess->expects($this->any())->method('checkSessionChallenge')->will($this->returnValue(true));
$oView = $this->getMock($this->getProxyClassName('Category_List'), array('getSession'));
$oView->expects($this->any())->method('getSession')->will($this->returnValue($oSess));
$oView->init();
$this->assertEquals(array("oxcategories" => array("oxrootid" => "desc", "oxleft" => "asc")), $oView->getListSorting());
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:16,代码来源:categorylistTest.php
示例19: testRender
/**
* VoucherSerie_Groups::Render() test case
*
* @return null
*/
public function testRender()
{
$this->setRequestParameter("oxid", "testId");
oxTestModules::addFunction('oxvoucherserie', 'isDerived', '{ return true; }');
// testing..
$oView = oxNew('VoucherSerie_Groups');
$this->assertEquals('voucherserie_groups.tpl', $oView->render());
$aViewData = $oView->getViewData();
$this->assertTrue(isset($aViewData['edit']));
$this->assertTrue($aViewData['edit'] instanceof oxvoucherserie);
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:16,代码来源:voucherseriegroupsTest.php
示例20: testRender
/**
* News_Main::Render() test case
*
* @return null
*/
public function testRender()
{
oxTestModules::addFunction('oxnewsletter', 'prepare', '{}');
$this->setRequestParameter("oxid", "testId");
// testing..
$oView = oxNew('Newsletter_Preview');
$this->assertEquals('newsletter_preview.tpl', $oView->render());
$aViewData = $oView->getViewData();
$this->assertTrue(isset($aViewData['edit']));
$this->assertTrue($aViewData['edit'] instanceof oxnewsletter);
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:16,代码来源:newsletterpreviewTest.php
注:本文中的oxTestModules类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论