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

PHP UnitTestCase类代码示例

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

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



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

示例1: addTestCase

 public function addTestCase(UnitTestCase $testCase)
 {
     if ($testCase instanceof GroupTest) {
         $this->_testCases = array_merge($this->_testCases, $testCase->getTestCases());
     } else {
         $this->_testCases[get_class($testCase)] = $testCase;
     }
 }
开发者ID:ninjapenguin,项目名称:kohana-Doctrine-module,代码行数:8,代码来源:GroupTest.php


示例2: test_AkActiveRecord_actAsTree

 function test_AkActiveRecord_actAsTree()
 {
     parent::UnitTestCase();
     $this->_createNewTestingModelDatabase('AkTestCategory');
     $this->_createNewTestingModel('AkTestCategory');
     $this->_createNewTestingModel('AkDependentTestCategory');
 }
开发者ID:joeymetal,项目名称:v1,代码行数:7,代码来源:AkActsAsTree.php


示例3: TestUpload

 function TestUpload()
 {
     parent::UnitTestCase();
     $this->CI =& get_instance();
     $this->DBI = $this->CI->load->database('testing', TRUE);
     $this->setUpDB();
 }
开发者ID:cybercog,项目名称:exambuff,代码行数:7,代码来源:testupload.php


示例4: run

 /**
  *    Uses reflection to run every method within itself
  *    starting with the string "test" unless a method
  *    is specified.
  *    @param SimpleReporter $reporter    Current test reporter.
  *    @return boolean                    True if all tests passed.
  *    @access public
  */
 function run(&$reporter)
 {
     $this->setUpFixture();
     $ret = parent::run($reporter);
     $this->tearDownFixture();
     return $ret;
 }
开发者ID:hostinger,项目名称:revive-adserver,代码行数:15,代码来源:DalUnitTestCase.php


示例5: Date

 /**
  * The constructor method.
  */
 function __construct()
 {
     $oServiceLocator =& OA_ServiceLocator::instance();
     $oNow = new Date('2008-04-01 12:30:00');
     $oServiceLocator->register('now', $oNow);
     parent::__construct();
 }
开发者ID:hostinger,项目名称:revive-adserver,代码行数:10,代码来源:Status.mtc.test.php


示例6: rand

 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     Mock::generate('OA_Dal_Maintenance_Priority', $this->mockDal = 'MockOA_Dal_Maintenance_Priority' . rand());
     Mock::generatePartial('OA_Maintenance_Priority_AdServer_Task_PriorityCompensation', 'PartialMock_OA_Maintenance_Priority_AdServer_Task_PriorityCompensation', array('_getDal', '_getOperationIntUtils', '_getMaxEntityAdObject'));
     Mock::generatePartial('OA_Maintenance_Priority_Ad', 'PartialOA_Maintenance_Priority_Ad', array());
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:10,代码来源:PriorityCompensation.mtp.test.php


示例7: tempnam

 function __construct()
 {
     parent::__construct();
     $username = 'cctm';
     $password = 'cctm';
     $login_url = 'http://cctm:8888/wp-login.php';
     $this->ckfile = tempnam('/tmp', 'CURLCOOKIE');
     $post_data = array();
     $post_data['log'] = $username;
     $post_data['pwd'] = $password;
     foreach ($post_data as $key => $value) {
         $post_items[] = $key . '=' . $value;
     }
     $post_string = implode('&', $post_items);
     $ch = curl_init($login_url);
     curl_setopt($ch, CURLOPT_COOKIEJAR, $this->ckfile);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
     curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
     $result = curl_exec($ch);
     curl_close($ch);
 }
开发者ID:ethaizone,项目名称:custom-content-type-manager,代码行数:26,代码来源:CCTMUnitTestsMgr.php


示例8: array

 /**
  * The class constructor method.
  */
 function __construct()
 {
     parent::__construct();
     Mock::generate('MAX_Dal_Entities');
     Mock::generate('OA_Dal_Maintenance_Priority');
     Mock::generatePartial('OX_Maintenance_Priority_Campaign', 'MockPartialOX_Maintenance_Priority_Campaign', array('_abort'));
 }
开发者ID:esclapes,项目名称:revive-adserver,代码行数:10,代码来源:Campaign.mtp.test.php


示例9: setUp

 function setUp()
 {
     // @todo mock the tokenizer
     $this->proc = new Elgg_Ecml_Processor(new Elgg_Ecml_Tokenizer());
     elgg_register_plugin_hook_handler('view', 'output/text', 'ecml_process_view');
     parent::setUp();
 }
开发者ID:lorea,项目名称:Hydra-dev,代码行数:7,代码来源:Elgg_Ecml_ProcessorTest.php


示例10: setUp

 function setUp()
 {
     parent::setUp();
     $this->factory = TestHelper::getPartialMock('Tracker_CrossSearch_SharedFieldFactory', array('getDao'));
     $this->dao = new MockTracker_CrossSearch_SharedFieldDao();
     $this->factory->setReturnValue('getDao', $this->dao);
 }
开发者ID:nickl-,项目名称:tuleap,代码行数:7,代码来源:SharedFieldFactoryTest.php


示例11: tearDown

 public function tearDown()
 {
     parent::tearDown();
     unset($GLOBALS['sys_force_ssl']);
     unset($GLOBALS['sys_default_domain']);
     unset($GLOBALS['sys_https_host']);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:Webdav_URLVerificationTest.php


示例12: tearDown

 function tearDown()
 {
     if (file_exists($this->cache_file)) {
         unlink($this->cache_file);
     }
     parent::tearDown();
 }
开发者ID:anykey84,项目名称:YaBackup,代码行数:7,代码来源:lmbCachingFileLocatorTest.class.php


示例13: SimpleRunner

  function &_createRunner(&$reporter)
  {
    if ($this->_isDebugging())
      return new SimpleRunner($this, $reporter);

    return parent::_createRunner($reporter);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:limb_test_case.class.php


示例14: array

 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     $this->oDbh = OA_DB::singleton();
     $this->oCache = new OA_DB_XmlCache();
     $this->oSchema =& MDB2_Schema::factory($this->oDbh, array('force_defaults' => false));
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:10,代码来源:XmlCache.tbl.test.php


示例15: __construct

 public function __construct()
 {
     $this->environ = new MongoTestEnvironment();
     $this->environ->clean();
     $this->save = array();
     parent::__construct();
 }
开发者ID:bbriggs,项目名称:web-languageforge,代码行数:7,代码来源:ProjectCommands_Test.php


示例16:

 function __construct()
 {
     parent::__construct();
     $c = new Naf_UnitTestDbConnection();
     $this->connection = $c->getConnection();
     Naf_Table::setDefaultConnection($this->connection);
 }
开发者ID:BackupTheBerlios,项目名称:naf-svn,代码行数:7,代码来源:Abstract.php


示例17:

 function __construct()
 {
     parent::__construct('Kademlia HTTP Test');
     return;
     #############################
     $this->node = KademliaTestFactory::constructNode(['protocols' => [Kademlia\Http::protocol_id => ['protocol' => 'http', 'host' => '10.0.0.1', 'port' => 8080, 'path' => '/kad/kademlia']]]);
 }
开发者ID:rongzedong,项目名称:kademlia.php,代码行数:7,代码来源:test_http.php


示例18:

 function __construct()
 {
     parent::__construct('Kademlia Bucket Test');
     $settings = new Kademlia\Settings();
     $settings->own_node_id = Kademlia\Node::randomNodeId();
     $this->settings = $settings;
 }
开发者ID:rongzedong,项目名称:kademlia.php,代码行数:7,代码来源:test_bucket.php


示例19: setUp

 function setUp()
 {
     $this->_clean_up();
     parent::setUp();
     debug_mock::init($this);
     $this->object =& new phpbb_user();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:phpbb_user_test.class.php


示例20: __construct

 public function __construct($path)
 {
     $this->_path = $path;
     $this->_parser = new HTMLPurifier_StringHashParser();
     $this->_builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
     parent::__construct($path);
 }
开发者ID:Jaaviieer,项目名称:PrograWeb,代码行数:7,代码来源:ValidatorTestCase.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP UnitTester类代码示例发布时间:2022-05-23
下一篇:
PHP Unit类代码示例发布时间: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