• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP EcomDev_PHPUnit_Test_Case类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中EcomDev_PHPUnit_Test_Case的典型用法代码示例。如果您正苦于以下问题:PHP EcomDev_PHPUnit_Test_Case类的具体用法?PHP EcomDev_PHPUnit_Test_Case怎么用?PHP EcomDev_PHPUnit_Test_Case使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了EcomDev_PHPUnit_Test_Case类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * Set up controller params
  * (non-PHPdoc)
  * @see EcomDev_PHPUnit_Test_Case::setUp()
  */
 protected function setUp()
 {
     EcomDev_PHPUnit_Test_Case::setUp();
     $this->reset();
     //$this->registerCookieStub(); fix exception
     $this->getCookies()->reset();
     $this->app()->getFrontController()->init();
 }
开发者ID:all-bear,项目名称:magento.cg-cms,代码行数:13,代码来源:IndexController.php


示例2: getResourceCollectionModelMock

 /**
  * replaces a model resource collection
  * @param $classAlias
  * @param $dataValues
  * @return PHPUnit_Framework_MockObject_MockObject
  */
 public function getResourceCollectionModelMock($classAlias, $dataValues)
 {
     $mockPage1 = $this->getObjectMockGetData($dataValues[0]);
     $mockPage2 = $this->getObjectMockGetData($dataValues[1]);
     $iteratorValues = array($mockPage1, $mockPage2);
     $resourceCmsPageCollection = $this->testCase->getResourceModelMock($classAlias, array(), FALSE, array(), '', FALSE);
     $resourceCmsPageCollection->expects($this->testCase->any())->method('getIterator')->will($this->testCase->returnValue(new ArrayIterator($iteratorValues)));
     return $resourceCmsPageCollection;
 }
开发者ID:ThiagoR,项目名称:firegento-contentsync,代码行数:15,代码来源:Mocks.php


示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->helper = Mage::helper('helpdesk/notification');
     $this->helper->emails = array();
     Mage::helper('msttest/mock')->mockSingletonMethod('helpdesk/config', array('getNotificationHistoryRecordsNumber' => 3));
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:7,代码来源:Mirasvit_Helpdesk_Test_Helper_NotificationTest.php


示例4: setUp

 /**
  * Set up test class
  */
 protected function setUp()
 {
     parent::setUp();
     $this->_model = Mage::getModel('debit/entity_customer_attribute_backend_encrypted');
     $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('customer', 'debit_payment_account_swift');
     $this->_model->setAttribute($attribute);
 }
开发者ID:dedlich,项目名称:Magento-DebitPayment,代码行数:10,代码来源:Encrypted.php


示例5: setUp

 public function setUp()
 {
     parent::setup();
     $this->_helper = Mage::helper('ops/payment');
     $this->store = Mage::app()->getStore(0)->load(0);
     $this->store->resetConfig();
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:7,代码来源:PaymentTest.php


示例6: tearDown

 protected function tearDown()
 {
     parent::tearDown();
     $couponTable = Mage::getSingleton('core/resource')->getTableName('collpur/coupon');
     $write = Mage::getSingleton('core/resource')->getConnection('core_write');
     $write->truncate($couponTable);
 }
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:7,代码来源:AW_Collpur_Test_Model_Coupon.php


示例7: setUp

 /**
  * setUp method
  */
 public function setUp()
 {
     parent::setUp();
     // checking if var directory exists, if not, then create it
     if (!is_dir(Mage::getBaseDir('var'))) {
         umask(0);
         mkdir(Mage::getBaseDir('var'), 0777, true);
     }
     // checking if log directory exists, if not, then create it
     if (!is_dir(Mage::getBaseDir('log'))) {
         umask(0);
         mkdir(Mage::getBaseDir('log'), 0777, true);
     }
     // checking if var/log/system.log file exist, if not create it
     if (!file_exists(Mage::getBaseDir('log') . DS . 'system.log')) {
         file_put_contents(Mage::getBaseDir('log') . DS . 'system.log', '');
     }
     // checking if var/log/exception.log file exist, if not create it
     if (!file_exists(Mage::getBaseDir('log') . DS . 'exception.log')) {
         file_put_contents(Mage::getBaseDir('log') . DS . 'exception.log', '');
     }
     // Preventing actual e-mail from being sent.
     $email = $this->getModelMock('ebayenterprise_magelog/logger_email', ['send']);
     $email->expects($this->any())->method('send')->will($this->returnSelf());
     $this->replaceByMock('model', 'ebayenterprise_magelog/logger_email', $email);
 }
开发者ID:kojiromike,项目名称:magento-log,代码行数:29,代码来源:StreamTest.php


示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->helper = Mage::helper('helpdesk/mail');
     $this->helper->emails = array();
     $this->markTestSkipped('We don"t use this testclass.');
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:7,代码来源:Mirasvit_Helpdesk_Test_Helper_MailTest.php


示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $payment = Mage::getModel('sales/order_payment');
     $payment->setAdditionalInformation('CC_BRAND', 'VISA');
     $this->testObjects[] = Mage::getModel('ops/payment_cc')->setInfoInstance($payment);
     $this->testObjects[] = Mage::getModel('ops/payment_directDebit');
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:8,代码来源:DirectLinkTest.php


示例10: tearDown

 protected function tearDown()
 {
     $collection = $this->getTestCronScheduleCollection();
     foreach ($collection as $item) {
         $item->delete();
     }
     parent::tearDown();
 }
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:8,代码来源:Sync.php


示例11: setUp

 public function setUp()
 {
     parent::setUp();
     $this->_context = Mage::helper('ebayenterprise_magelog/context');
     // suppressing the real session from starting
     $session = $this->getModelMockBuilder('core/session')->disableOriginalConstructor()->setMethods(null)->getMock();
     $this->replaceByMock('singleton', 'core/session', $session);
 }
开发者ID:kojiromike,项目名称:magento-log,代码行数:8,代码来源:ContextTest.php


示例12: setUp

 public function setUp()
 {
     parent::setUp();
     $this->shipping = Mage::getModel('shipping/shipping');
     $this->observer = $this->getModelMock('checkoutrule/observer', array('shippingMethods'));
     $this->observer->expects($this->any())->method('shippingMethods')->will($this->returnCallback(array($this, 'processShippingMethods')));
     $this->replaceByMock('model', 'checkoutrule/observer', $this->observer);
 }
开发者ID:Hospeed,项目名称:Inovarti_PromoFilter,代码行数:8,代码来源:Shipping.php


示例13: setUp

 public function setUp()
 {
     parent::setUp();
     $this->_data = Mage::getModel('productquestions/productquestions');
     $this->_sess = Mage::getSingleton('core/session');
     $this->_customersess = Mage::getSingleton('customer/session');
     $this->_adminUrl = Mage::getSingleton('adminhtml/url');
     $this->_resource = Mage::getModel('productquestions/productquestions')->getResource();
 }
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:9,代码来源:AW_Productquestions_Test_Model_Productquestions.php


示例14: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->helper = Mage::helper('helpdesk/process');
     $this->mockConfigMethod(array('getDefaultStatus' => 1, 'getContactFormDefaultDepartment' => 2, 'getDefaultPriority' => 3, 'getNotificationIsShowCode' => true));
     if (!Mage::registry('isSecureArea')) {
         Mage::register('isSecureArea', true);
     }
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:9,代码来源:Mirasvit_Helpdesk_Test_Helper_ProcessTest.php


示例15: setUp

 protected function setUp()
 {
     parent::setUp();
     $resource = Mage::getSingleton('core/resource');
     $con = $resource->getConnection('core_write');
     $con->query("delete from {$resource->getTableName('helpdesk/email')}");
     $this->helper = Mage::helper('helpdesk/fetch');
     $this->mailbox = $this->createMailbox('test-message');
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:9,代码来源:Mirasvit_Helpdesk_Test_Helper_FetchTest.php


示例16: setUp

 /**
  * Set up test class
  */
 protected function setUp()
 {
     parent::setUp();
     $this->_model = Mage::getModel('debit/debit');
     $infoInstance = Mage::getModel('payment/info');
     $infoInstance->setMethod($this->_model->getCode());
     $infoInstance->setMethodInstance($this->_model);
     $this->_model->setData('info_instance', $infoInstance);
 }
开发者ID:dedlich,项目名称:Magento-DebitPayment,代码行数:12,代码来源:Debit.php


示例17: setUp

 /**
  * Set up AOP tests.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     // Make sure the AspectKernel is always initialized.
     Danslo_Aop_Model_Observer::initializeAspectKernel();
     // Because fixtures can change for every test, reconfigure AOP
     // with possibly new aspects.
     $kernel = Danslo_Aop_Aspect_Kernel::getInstance();
     $kernel->configureAop($kernel->getContainer());
 }
开发者ID:jurasm2,项目名称:Danslo_Aop,代码行数:15,代码来源:Case.php


示例18: tearDown

 public function tearDown()
 {
     $collection = $this->getProductSyncCronScheduleCollection();
     foreach ($collection as $item) {
         $item->delete();
     }
     $resource = Mage::getModel("core/resource");
     $resource->getConnection("core_write")->delete($resource->getTableName("klevu_search/order_sync"));
     parent::tearDown();
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:10,代码来源:Observer.php


示例19: tearDown

 public function tearDown()
 {
     $collection = $this->getProductSyncCronScheduleCollection();
     foreach ($collection as $item) {
         $item->delete();
     }
     $resource = Mage::getModel("core/resource");
     $resource->getConnection("core_write")->delete($resource->getTableName("klevu_search/order_sync"));
     EcomDev_Utils_Reflection::setRestrictedPropertyValue(Mage::getConfig(), "_classNameCache", array());
     parent::tearDown();
 }
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:11,代码来源:Observer.php


示例20: setUp

 public function setUp()
 {
     parent::setup();
     $this->_helper = Mage::helper('ops/directlink');
     $transaction = Mage::getModel('sales/order_payment_transaction');
     $transaction->setAdditionalInformation('arrInfo', serialize(array('amount' => '184.90')));
     $transaction->setIsClosed(0);
     $this->_transaction = $transaction;
     $this->_order = Mage::getModel('sales/order');
     $this->_order->setGrandTotal('184.90');
     $this->_order->setBaseGrandTotal('184.90');
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:12,代码来源:DirectLinkTest.php



注:本文中的EcomDev_PHPUnit_Test_Case类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP EcomDev_Utils_Reflection类代码示例发布时间:2022-05-23
下一篇:
PHP EbayEnterprise_MageLog_Helper_Context类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap