/** * enable testTsRatings */ protected function _enableTsRatings() { $oServiceCaller = new \OxidEsales\TestingLibrary\ServiceCaller(); $oServiceCaller->setParameter('cl', 'dyn_trusted'); $oServiceCaller->setParameter('fnc', 'save'); $oServiceCaller->setParameter('editval', array('oxshops__oxid' => oxSHOPID)); $oServiceCaller->setParameter('aTsUser', array('', '')); $oServiceCaller->setParameter('aTsPassword', array('', '')); $oServiceCaller->setParameter('tsSealActive', true); $oServiceCaller->setParameter('aShopID_TrustedShops', array($this->getLoginDataByName('trustedShopsIdForLanguageDe'), $this->getLoginDataByName('trustedShopsIdForLanguageEn'))); $oServiceCaller->setParameter('paymentids', array("oxidcashondel" => "DIRECT_DEBIT", "oxidcreditcard" => "DIRECT_DEBIT", "oxiddebitnote" => "DIRECT_DEBIT", "oxidpayadvance" => "DIRECT_DEBIT", "oxidinvoice" => "DIRECT_DEBIT", "oxempty" => "DIRECT_DEBIT", "testpayment" => "DIRECT_DEBIT")); $_POST = $oServiceCaller->getParameters(); try { $oServiceCaller->callService('ShopObjectConstructor'); } catch (Exception $oException) { $this->fail("Exception caught calling ShopObjectConstructor with message: '{$oException->getMessage()}'"); } }
<?php $serviceCaller = new \OxidEsales\TestingLibrary\ServiceCaller(); $testConfig = new \OxidEsales\TestingLibrary\TestConfig(); if ($testConfig->getShopEdition() === 'CE') { $serviceCaller->setParameter('importSql', '@' . __DIR__ . '/Fixtures/testdata.sql'); } if ($testConfig->getShopEdition() === 'PE') { $serviceCaller->setParameter('importSql', '@' . $testConfig->getShopPath() . '/Edition/Professional/Tests/Fixtures/testdata.sql'); } if ($testConfig->getShopEdition() === 'EE') { $serviceCaller->setParameter('importSql', '@' . $testConfig->getShopPath() . '/Edition/Enterprise/Tests/Fixtures/testdata.sql'); } $serviceCaller->callService('ShopPreparation', 1); define('oxADMIN_LOGIN', oxDb::getDb()->getOne("select OXUSERNAME from oxuser where oxid='oxdefaultadmin'")); define('oxADMIN_PASSWD', getenv('oxADMIN_PASSWD') ? getenv('oxADMIN_PASSWD') : 'admin');
<?php $serviceCaller = new \OxidEsales\TestingLibrary\ServiceCaller(); $testConfig = new \OxidEsales\TestingLibrary\TestConfig(); if ($testConfig->getShopEdition() === 'CE') { $serviceCaller->setParameter('importSql', '@' . __DIR__ . '/Fixtures/testdata.sql'); } if ($testConfig->getShopEdition() === 'PE') { $serviceCaller->setParameter('importSql', '@' . $testConfig->getVendorDirectory() . '/oxid-esales/oxideshop-pe/Tests/Fixtures/testdata.sql'); } if ($testConfig->getShopEdition() === 'EE') { $serviceCaller->setParameter('importSql', '@' . $testConfig->getVendorDirectory() . '/oxid-esales/oxideshop-ee/Tests/Fixtures/testdata.sql'); } $serviceCaller->callService('ShopPreparation', 1); define('oxADMIN_LOGIN', oxDb::getDb()->getOne("select OXUSERNAME from oxuser where oxid='oxdefaultadmin'")); define('oxADMIN_PASSWD', getenv('oxADMIN_PASSWD') ? getenv('oxADMIN_PASSWD') : 'admin');