本文整理汇总了PHP中oxAddClassModule函数的典型用法代码示例。如果您正苦于以下问题:PHP oxAddClassModule函数的具体用法?PHP oxAddClassModule怎么用?PHP oxAddClassModule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了oxAddClassModule函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInit
/**
* Test method init()
*/
public function testInit()
{
oxAddClassModule('GenericImportTest_oxUtilsServer', 'oxUtilsServer');
$oImport = new GenericImport();
/** @var oxUser|MockObject $oUser */
$oUser = $this->getMock('oxUser', array('isAdmin'));
$oUser->expects($this->any())->method('isAdmin')->will($this->returnValue(true));
$oUser->login(oxADMIN_LOGIN, oxADMIN_PASSWD);
$oUser->loadAdminUser();
$this->assertTrue($oImport->init());
}
示例2: testInsert
public function testInsert()
{
$iTime = time();
oxAddClassModule('modOxUtilsDate', 'oxUtilsDate');
oxRegistry::get("oxUtilsDate")->UNITSetTime($iTime);
$this->_oObj->delete();
// resaving
$this->_oObj->oxgbentries__oxcreate = new oxField(null, oxField::T_RAW);
$this->_oObj->save();
$this->assertEquals(date('Y-m-d H:i:s', $iTime), $this->_oObj->oxgbentries__oxcreate->value);
}
示例3: testInsert
public function testInsert()
{
oxAddClassModule('modOxUtilsDate', 'oxUtilsDate');
oxRegistry::get("oxUtilsDate")->UNITSetTime(100);
$oAlarm = oxNew('oxpricealarm');
$oAlarm->setId('testalarm');
$oAlarm->save();
$oAlarm = oxNew('oxpricealarm');
$oAlarm->load('testalarm');
$this->assertEquals('1970-01-01 00:00:00', $oAlarm->oxpricealarm__oxinsert->value);
}
示例4: testInsert
public function testInsert()
{
$iNow = time();
oxAddClassModule('modOxUtilsDate', 'oxUtilsDate');
oxRegistry::get("oxUtilsDate")->UNITSetTime($iNow);
$oRemark = oxNew('oxremark');
$oRemark->load($this->_oRemark->oxremark__oxid->value);
$oRemark->delete();
$oRemark = oxNew('oxremark');
$oRemark->setId($this->_oRemark->oxremark__oxid->value);
$oRemark->save();
$this->assertEquals(date('Y-m-d H:i:s', $iNow), $oRemark->oxremark__oxcreate->value);
}
示例5: setUp
/**
* Initialize the fixture.
*
* @return null
*/
protected function setUp()
{
parent::setUp();
oxAddClassModule('Unit\\Application\\Model\\modOxDelivery', 'oxDelivery');
$this->cleanUpTable('oxdelivery');
$this->cleanUpTable('oxobject2delivery');
$this->cleanUpTable('oxarticles');
$this->aArticleIds = array();
$oDelivery = oxNew('oxDelivery');
$oDelivery->setId('_testDeliveryId');
$oDelivery->oxdelivery__oxtitle = new oxField('test_oxDelivery', oxField::T_RAW);
$oDelivery->save();
$this->_sOxId = $oDelivery->getId();
// insert test articles
for ($i = 1; $i <= 3; $i++) {
$oArticle = oxNew("oxArticle");
$oArticle->setId('_testArticleId' . $i);
$oArticle->oxarticles__oxtitle = new oxField('testArticle' . $i, oxField::T_RAW);
$oArticle->oxarticles__oxartnum = new oxField(1000 + $i, oxField::T_RAW);
$oArticle->oxarticles__oxshortdesc = new oxField('testArticle' . $i . 'Description', oxField::T_RAW);
$oArticle->oxarticles__oxprice = new oxField('256', oxField::T_RAW);
$oArticle->oxarticles__oxremindactive = new oxField('1', oxField::T_RAW);
$oArticle->oxarticles__oxstock = new oxField('9', oxField::T_RAW);
$oArticle->oxarticles__oxlength = new oxField('2', oxField::T_RAW);
$oArticle->oxarticles__oxwidth = new oxField('4', oxField::T_RAW);
$oArticle->oxarticles__oxheight = new oxField('6', oxField::T_RAW);
$oArticle->oxarticles__oxweight = new oxField('5', oxField::T_RAW);
$oArticle->save();
$this->aArticleIds[] = $oArticle->getId();
}
// some demo data
$sQ = 'insert into oxobject2delivery (`OXID`, `OXDELIVERYID`, `OXOBJECTID`, `OXTYPE`) values ';
$sQ .= '("_testId1", "' . $this->_sOxId . '", "_testArticleId1", "oxarticles" ), ';
$sQ .= '("_testId2", "' . $this->_sOxId . '", "_testArticleId2", "oxarticles" ), ';
$sQ .= '("_testId3", "' . $this->_sOxId . '", "_testArticleId3", "oxarticles" )';
oxDb::getInstance()->getDb()->Execute($sQ);
$sQ = 'insert into oxobject2delivery (`OXID`, `OXDELIVERYID`, `OXOBJECTID`, `OXTYPE`) values ';
$sQ .= '("_testId4", "' . $this->_sOxId . '", "category_id1", "oxcategories" ), ';
$sQ .= '("_testId5", "' . $this->_sOxId . '", "category_id2", "oxcategories" ), ';
$sQ .= '("_testId6", "' . $this->_sOxId . '", "category_id3", "oxcategories" )';
oxDb::getInstance()->getDb()->Execute($sQ);
$this->aCategoryIds = array("category_id1", "category_id2", "category_id3");
// preparing basket item
$this->_oBasketItem = $this->getProxyClass("oxbasketitem");
$this->_oBasketItem->init('_testArticleId1', 2);
$oPrice = oxNew('oxprice');
$oPrice->setPrice(256, 0);
$this->_oBasketItem->setPrice($oPrice);
oxArticleHelper::cleanup();
oxDeliveryHelper::cleanup();
}
示例6: setUp
/**
* Initialize the fixture.
*
* @return null
*/
protected function setUp()
{
$this->_aBackup['_SERVER'] = $_SERVER;
$this->_aBackup['_POST'] = $_POST;
$this->_aBackup['_GET'] = $_GET;
$this->_aBackup['_SESSION'] = $_SESSION;
$this->_aBackup['_COOKIE'] = $_COOKIE;
parent::setUp();
error_reporting(E_ALL ^ E_NOTICE | E_STRICT);
ini_set('display_errors', true);
$this->getConfig();
$this->getSession();
$this->setAdminMode(false);
$this->setShopId(null);
oxAddClassModule('modOxUtilsDate', 'oxUtilsDate');
oxRegistry::getUtils()->cleanStaticCache();
error_reporting(E_ALL ^ E_NOTICE | E_STRICT);
ini_set('display_errors', true);
}
示例7: testAddVoucherSkipChecking
/**
* test if vouhers availability checking was skipped if skip param is on
*
* @return null
*/
public function testAddVoucherSkipChecking()
{
oxAddClassModule('oxVoucherHelper', 'oxvoucher');
oxVoucherHelper::$blCheckWasPerformed = false;
$sVoucher = key($this->aVouchers);
$oVoucher = $this->aVouchers[$sVoucher];
$oPrice = oxNew("oxPrice");
$oPrice->setPrice(999);
$oPriceList = oxNew("oxPriceList");
$oPriceList->addToPriceList($oPrice);
$oBasket = $this->getProxyClass("oxBasket");
$oBasket->setNonPublicVar('_oDiscountProductsPriceList', $oPriceList);
$oBasket->setSkipVouchersChecking(true);
$oBasket->addVoucher($sVoucher);
$this->assertFalse(oxVoucherHelper::$blCheckWasPerformed);
}
示例8: testValidatePayment_NoStoreCardInfoRequest
/**
* Testing Payment::ValidatePayment() when we use creditcard payment
* and do not store CC data, using CC entered data from $_REQUEST, $_POST or $_GET
*
* @return null
*/
public function testValidatePayment_NoStoreCardInfoRequest()
{
$oUser = oxNew('oxUser');
$oUser->load('oxdefaultadmin');
oxAddClassModule('modOxPayment_payment', 'oxPayment');
$oBasket = $this->getMock('oxBasket', array('getPriceForPayment'));
$oBasket->expects($this->any())->method('getPriceForPayment')->will($this->returnValue(100));
$oBasket->setShipping('currentShipping');
$oSession = $this->getMock('oxSession', array('getBasket'));
$oSession->expects($this->any())->method('getBasket')->will($this->returnValue($oBasket));
$oPayment = $this->getMock('Payment', array('getUser', 'getSession'));
$oPayment->expects($this->any())->method('getUser')->will($this->returnValue($oUser));
$oPayment->expects($this->any())->method('getSession')->will($this->returnValue($oSession));
$this->setRequestParameter("paymentid", 'oxidcreditcard');
$this->setConfigParam("blStoreCreditCardInfo", 0);
$sTNumber = "4111111111111111";
$sTName = "Hans Mustermann";
$sTMonth = "01";
$sTYear = "2013";
$sTProof = "333";
$sTTtype = "vis";
$_REQUEST["dynvalue"]["kktype"] = $sTTtype;
$_REQUEST["dynvalue"]["kknumber"] = $sTNumber;
$_REQUEST["dynvalue"]["kkname"] = $sTName;
$_REQUEST["dynvalue"]["kkmonth"] = $sTMonth;
$_REQUEST["dynvalue"]["kkyear"] = $sTYear;
$_REQUEST["dynvalue"]["kkpruef"] = $sTProof;
$_POST["dynvalue"]["kktype"] = $sTTtype;
$_POST["dynvalue"]["kknumber"] = $sTNumber;
$_POST["dynvalue"]["kkname"] = $sTName;
$_POST["dynvalue"]["kkmonth"] = $sTMonth;
$_POST["dynvalue"]["kkyear"] = $sTYear;
$_POST["dynvalue"]["kkpruef"] = $sTProof;
$_GET["dynvalue"]["kktype"] = $sTTtype;
$_GET["dynvalue"]["kknumber"] = $sTNumber;
$_GET["dynvalue"]["kkname"] = $sTName;
$_GET["dynvalue"]["kkmonth"] = $sTMonth;
$_GET["dynvalue"]["kkyear"] = $sTYear;
$_GET["dynvalue"]["kkpruef"] = $sTProof;
$oPayment->init();
$sRetVal = $oPayment->validatePayment();
$this->assertEquals(null, $sRetVal);
}
示例9: testGetPayment_userBasketPriceForPayment
/**
* Test if method for validating payment uses basket price
* getted from oxBasket::getPriceForPayment()
*
* @return null
*/
public function testGetPayment_userBasketPriceForPayment()
{
$oUser = oxNew('oxuser');
$oUser->load('oxdefaultadmin');
$oBasket = $this->getMock('oxBasket', array('getPriceForPayment', 'getPaymentId'));
$oBasket->expects($this->once())->method('getPriceForPayment')->will($this->returnValue(100));
$oBasket->expects($this->once())->method('getPaymentId')->will($this->returnValue('oxidinvoice'));
oxAddClassModule('modOxPaymentIsValid_order', 'oxPayment');
$oOrder = $this->getMock('Order', array('getBasket'));
$oOrder->expects($this->once())->method('getBasket')->will($this->returnValue($oBasket));
$oOrder->getPayment();
$this->assertEquals(100, modOxPaymentIsValid_order::$dBasketPrice);
}
示例10: setUp
/**
* Initialize the fixture.
*/
protected function setUp()
{
parent::setUp();
// set to load full deliveries list
$this->getConfig()->setConfigParam('bl_perfLoadDelivery', true);
oxAddClassModule('Unit\\Application\\Model\\oxDeliveryListTestClass', 'oxDeliveryList');
// inserting some demo data
//set default user
$this->_oUser = oxNew("oxUser");
$this->_oUser->setId('_testUserId');
$this->_oUser->oxuser__oxactive = new oxField('1', oxField::T_RAW);
$this->_oUser->save();
//add user address
$oAdress = oxNew('oxBase');
$oAdress->init('oxaddress');
$oAdress->setId('_testAddressId');
$oAdress->oxaddress__oxuserid = new oxField($this->_oUser->getId(), oxField::T_RAW);
$oAdress->oxaddress__oxaddressuserid = new oxField($this->_oUser->getId(), oxField::T_RAW);
$oAdress->oxaddress__oxcountryid = new oxField('a7c40f6323c4bfb36.59919433', oxField::T_RAW);
//italien
$oAdress->save();
$this->getSession()->setVariable('deladrid', '_testAddressId');
//add user to group
$oO2Group = oxNew('oxBase');
$oO2Group->init('oxobject2group');
$oO2Group->setId('_testO2GId');
$oO2Group->oxobject2group__oxobjectid = new oxField('_testUserId', oxField::T_RAW);
$oO2Group->oxobject2group__oxgroupsid = new oxField('oxidadmin', oxField::T_RAW);
$oO2Group->save();
// delivery set
$oDelSet = oxNew('oxDeliverySet');
$oDelSet->setId('_testDeliverySetId');
$oDelSet->oxdeliveryset__oxactive = new oxField(1, oxField::T_RAW);
$oDelSet->save();
$this->_aDeliverySets[] = $oDelSet;
// 1. creating category for test
$oCategory = oxNew('oxCategory');
$oCategory->setId('_testCategoryId');
$oCategory->oxcategories__oxtitle = new oxField('_testCategoryTitle', oxField::T_RAW);
$oCategory->oxcategories__oxactive = new oxField(1, oxField::T_RAW);
$oCategory->oxcategories__oxshopid = new oxField($this->getConfig()->getBaseShopId(), oxField::T_RAW);
$oCategory->oxcategories__oxhidden = new oxField(0, oxField::T_RAW);
$oCategory->oxcategories__oxdefsortmode = new oxField(0, oxField::T_RAW);
$oCategory->oxcategories__oxparentid = new oxField('oxrootid', oxField::T_RAW);
$oCategory->save();
$this->_aCategories[] = $oCategory;
//3. insert test articles
for ($i = 1; $i <= 3; $i++) {
$oArticle = oxNew("oxArticle");
$oArticle->setId('_testArticleId' . $i);
$oArticle->oxarticles__oxtitle = new oxField('testArticle' . $i, oxField::T_RAW);
$oArticle->oxarticles__oxartnum = new oxField(1000 + $i, oxField::T_RAW);
$oArticle->oxarticles__oxshortdesc = new oxField('testArticle' . $i . 'Description', oxField::T_RAW);
$oArticle->oxarticles__oxprice = new oxField('256', oxField::T_RAW);
$oArticle->oxarticles__oxstock = new oxField('9', oxField::T_RAW);
$oArticle->oxarticles__oxshopid = new oxField(1, oxField::T_RAW);
$oArticle->save();
$this->_aTestProducts[] = $oArticle;
// 2.1 assigning products to category
$oO2Cat = oxNew('oxobject2category');
$oO2Cat->setId('_testO2CatId' . $i);
$oO2Cat->oxobject2category__oxobjectid = new oxField($oArticle->getId(), oxField::T_RAW);
$oO2Cat->oxobject2category__oxshopid = new oxField($this->getConfig()->getShopId(), oxField::T_RAW);
$oO2Cat->oxobject2category__oxcatnid = new oxField($oCategory->getId(), oxField::T_RAW);
$oO2Cat->save();
}
// some deliveries
for ($i = 1; $i <= 3; $i++) {
$oDelivery = oxNew('oxDelivery');
$oDelivery->setId('_testDeliveryId' . $i);
$oDelivery->oxdelivery__oxtitle = new oxField('_testDelivertTitle' . $i, oxField::T_RAW);
$oDelivery->oxdelivery__oxactive = new oxField(1, oxField::T_RAW);
$oDelivery->oxdelivery__oxdeltype = new oxField('p', oxField::T_RAW);
$oDelivery->oxdelivery__oxparam = new oxField(0, oxField::T_RAW);
$oDelivery->oxdelivery__oxparamend = new oxField(999999, oxField::T_RAW);
$oDelivery->oxdelivery__oxaddsum = new oxField(100, oxField::T_RAW);
$oDelivery->oxdelivery__oxfixed = new oxField(0, oxField::T_RAW);
$oDelivery->oxdelivery__oxsort = new oxField(3 - $i, oxField::T_RAW);
$oDelivery->oxdelivery__oxfinalize = new oxField(0, oxField::T_RAW);
//$oDelivery->blForCat = true;
$oDelivery->save();
$this->_aDeliveries[] = $oDelivery;
$oDel2Delset = oxNew('oxBase');
$oDel2Delset->init('oxdel2delset');
$oDel2Delset->setId('_testDel2DelSetId' . $i);
$oDel2Delset->oxdel2delset__oxdelid = new oxField($oDelivery->getId(), oxField::T_RAW);
$oDel2Delset->oxdel2delset__oxdelsetid = new oxField($oDelSet->getId(), oxField::T_RAW);
$oDel2Delset->save();
}
oxArticleHelper::cleanup();
}
示例11: testExecuteNewActionSslIsAdmin
public function testExecuteNewActionSslIsAdmin()
{
$this->getSession()->setId('SID');
oxAddClassModule("oxUtilsHelper", "oxutils");
$config = $this->getMock('oxconfig', array('isSsl', 'getSslShopUrl', 'getShopUrl'));
$config->expects($this->once())->method('isSsl')->will($this->returnValue(true));
$config->expects($this->once())->method('getSslShopUrl')->will($this->returnValue('SSLshopurl/'));
$config->expects($this->never())->method('getShopUrl');
$config->setConfigParam('sAdminDir', 'admin');
$oView = $this->getMock('oxview', array('getConfig', 'isAdmin'));
$oView->expects($this->once())->method('getConfig')->will($this->returnValue($config));
$oView->expects($this->once())->method('isAdmin')->will($this->returnValue(true));
$oView->UNITexecuteNewAction("details?fnc=somefnc&anid=someanid");
$this->assertEquals('SSLshopurl/admin/index.php?cl=details&fnc=somefnc&anid=someanid&' . $this->getSession()->sid(), oxUtilsHelper::$sRedirectUrl);
}
示例12: testAssignParseLongDescInList
public function testAssignParseLongDescInList()
{
oxAddClassModule('oxcategoryTest_oxUtilsView', 'oxUtilsView');
$this->getConfig()->setConfigParam('bl_perfParseLongDescinSmarty', true);
$this->_oCategory->oxcategories__oxlongdesc = new oxField('aa[{* smarty comment *}]zz', oxField::T_RAW);
$this->_oCategory->setId('test33');
$this->_oCategory->save();
$oObj3 = oxNew("oxCategory");
$oObj3->setInList();
$oObj3->load($this->_oCategory->getId());
//NOT parsed
$this->assertEquals('aa[{* smarty comment *}]zz', $oObj3->oxcategories__oxlongdesc->value);
}
示例13: testGetArticleTestingIfGetterWorksFine
public function testGetArticleTestingIfGetterWorksFine()
{
oxAddClassModule('modOxArticle_oxUserBasketItem', 'oxArticle');
$sProductId = "2000";
$oBasketItem = oxNew('oxuserbasketitem');
$oBasketItem->setVariantParentBuyable(true);
$oBasketItem->oxuserbasketitems__oxartid = new oxField($sProductId, oxField::T_RAW);
$oArticle = $oBasketItem->getArticle("123");
$this->assertTrue($oArticle instanceof oxarticle);
$this->assertEquals($oArticle->getItemKey(), "123");
// if thi line one day will faile, probebly becaus these parameters are not public any more :)
// removed due to #4178
//$this->assertFalse( $oArticle->getClassVar('_blLoadVariants') );
}
示例14: testInsert_creationTime
/**
* Testing if after user basket create oxcreate field contains date
* of creation (M:1710)
*/
public function testInsert_creationTime()
{
$iTime = 999991;
oxAddClassModule('modOxUtilsDate', 'oxUtilsDate');
oxRegistry::get("oxUtilsDate")->UNITSetTime($iTime);
$oBasket = oxNew('oxUserBasket');
$oBasket->setId("_testUserBasketId");
$oBasket->save();
$this->assertEquals($iTime, $oBasket->oxuserbaskets__oxupdate->value);
}
示例15: testGetArticle_notVisibleArticle
/**
* Testing if method throws an exception if article is not visible (M:1286)
*
* @return null
*/
public function testGetArticle_notVisibleArticle()
{
oxAddClassModule('modOxArticle_notVisible_oxbasketItem', 'oxArticle');
$article = $this->createArticle();
$oBasketItem = oxNew('oxBasketItem');
try {
$oBasketItem->getArticle(true, $article->getId());
} catch (oxNoArticleException $oEx) {
oxRemClassModule('modOxArticle_notVisible_oxbasketItem');
return;
}
oxRemClassModule('modOxArticle_notVisible_oxbasketItem');
$this->fail('Execption was not thrown when article is not visible');
}