當前位置: 首頁>>代碼示例>>PHP>>正文


PHP oxTestModules::addFunction方法代碼示例

本文整理匯總了PHP中oxTestModules::addFunction方法的典型用法代碼示例。如果您正苦於以下問題:PHP oxTestModules::addFunction方法的具體用法?PHP oxTestModules::addFunction怎麽用?PHP oxTestModules::addFunction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在oxTestModules的用法示例。


在下文中一共展示了oxTestModules::addFunction方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例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: 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

示例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: 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

示例7: testGetChannel

 public function testGetChannel()
 {
     oxTestModules::addFunction('oxrssfeed', 'setChannel', '{$this->_aChannel = $aA[0];}');
     $o = $this->getProxyClass("rss");
     $oRss = oxNew("oxRssFeed");
     $oRss->setChannel('asd');
     $o->setNonPublicVar("_oRss", $oRss);
     $this->assertEquals('asd', $o->getChannel());
 }
開發者ID:Crease29,項目名稱:oxideshop_ce,代碼行數:9,代碼來源:rssTest.php

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: testToBasketReturnsNull

 public function testToBasketReturnsNull()
 {
     /** @var oxcmp_basket|PHPUnit_Framework_MockObject_MockObject $o */
     $o = $this->getMock('oxcmp_basket', array('_getItems'));
     $o->expects($this->once())->method('_getItems')->will($this->returnValue(false));
     oxTestModules::addFunction('oxUtils', 'isSearchEngine', '{return true;}');
     $this->assertSame(null, $o->tobasket());
     oxTestModules::addFunction('oxUtils', 'isSearchEngine', '{return false;}');
     $this->assertSame(null, $o->tobasket());
 }
開發者ID:Crease29,項目名稱:oxideshop_ce,代碼行數:10,代碼來源:oxcmpBasketTest.php

示例15: 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


注:本文中的oxTestModules::addFunction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。