当前位置: 首页>>代码示例>>PHP>>正文


PHP UnitTestCase类代码示例

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


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

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

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

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

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

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

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

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

示例11: tearDown

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

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

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

示例14: __construct

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

示例15:

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


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