當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。