當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UnitTestCase::__construct方法代碼示例

本文整理匯總了PHP中UnitTestCase::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP UnitTestCase::__construct方法的具體用法?PHP UnitTestCase::__construct怎麽用?PHP UnitTestCase::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnitTestCase的用法示例。


在下文中一共展示了UnitTestCase::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 function __construct()
 {
     parent::__construct();
     // pseudo-default value
     // php quirks - static class members are not reset after each test.
     Config::setIdSeparator('---');
 }
開發者ID:hypercharge,項目名稱:hypercharge-php,代碼行數:7,代碼來源:HyperchargeTest.php

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

示例3:

 function __construct()
 {
     parent::__construct();
     $c = new Naf_UnitTestDbConnection();
     $this->connection = $c->getConnection();
     Naf_Table::setDefaultConnection($this->connection);
 }
開發者ID:BackupTheBerlios,項目名稱:naf-svn,代碼行數:7,代碼來源:Abstract.php

示例4: __construct

 public function __construct()
 {
     $this->environ = new MongoTestEnvironment();
     $this->environ->clean();
     $this->save = array();
     parent::__construct();
 }
開發者ID:bbriggs,項目名稱:web-languageforge,代碼行數:7,代碼來源:ProjectCommands_Test.php

示例5: __construct

 /**
  * Use __construct() instead of setUp() because it's unnecessary to set up 
  * the test case before every test method.
  */
 public function __construct()
 {
     parent::__construct();
     $this->_testAdapterFilename = TEST_ADAPTER_FILENAME;
     $this->_testAdapterClassName = TEST_ADAPTER_CLASS_NAME;
     $this->_testDocumentId = TEST_DOCUMENT_ID;
 }
開發者ID:hepplerj,項目名稱:Scripto,代碼行數:11,代碼來源:adapter_test.php

示例6:

 function __construct()
 {
     parent::__construct();
     $this->eppdrs = new EppDrs_Api_Client_Service(array("url" => "http://localhost/api/20111014", "key" => CONFIG::$API_KEY, "keyId" => CONFIG::$API_KEY_ID));
     $client = Client::Load(42);
     $this->eppdrs2 = new EppDrs_Api_Client_Service(array("url" => "http://localhost/api/20111014", "key" => $client->GetSettingValue(ClientSettings::API_KEY), "keyId" => $client->GetSettingValue(ClientSettings::API_KEY_ID)));
 }
開發者ID:rchicoria,項目名稱:epp-drs,代碼行數:7,代碼來源:tests.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     $this->specs = array();
     $this->tests = array();
     $parser = new sfYamlParser();
     $m = new Proust\Proust(array("enableCache" => true, "cacheDir" => dirname(__FILE__) . "/spec.cache", "compilerOptions" => array("beautify" => false, "includeDynamicPartials" => true)));
     $m->clearCache();
     $methods = array();
     foreach (glob(SPEC_DIR . "*.yml") as $file) {
         $name = str_replace(".yml", "", basename($file));
         $contents = file_get_contents($file);
         /* hack around sfyaml */
         $contents = str_replace("!code", "", $contents);
         $yaml = $parser->parse($contents);
         $yaml["name"] = $name;
         $i = 0;
         foreach ($yaml["tests"] as &$test) {
             if (array_key_exists("lambda", $test["data"])) {
                 $code = "return function (\$text = \"\") { " . $test["data"]["lambda"]["php"] . " };";
                 $test["data"]["lambda"] = eval($code);
             }
             $name = preg_replace('/[^a-zA-Z0-9]/', '_', $name);
             $test["method_name"] = "{$name}" . "_" . $i;
             array_push($methods, array($test["method_name"], $test["template"]));
             $this->tests[$name . "_{$i}"] = $test;
             $i++;
         }
         $this->specs[$name] = $yaml;
     }
     $classCode = $m->compileClass("Specs", $methods);
     eval($classCode);
     $m = new Proust\Proust(array("enableCache" => false));
     $this->obj = new Specs($m);
 }
開發者ID:sebcode,項目名稱:proust,代碼行數:35,代碼來源:testSpec.php

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

示例9:

 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     // Prepare the MSE DAL for use in the tests
     $oFactory = new OX_Dal_Maintenance_Statistics_Factory();
     $this->oDal = $oFactory->factory();
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:10,代碼來源:Statistics_deduplicateConversions.dal.test.php

示例10:

 function __construct()
 {
     require_once '../PelIfd.php';
     require_once '../PelTag.php';
     require_once '../PelEntryAscii.php';
     parent::__construct('PEL IFD Tests');
 }
開發者ID:BackupTheBerlios,項目名稱:pic2base-svn,代碼行數:7,代碼來源:ifd.php

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

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

示例13:

 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

示例14:

 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     Mock::generate('MAX_Dal_Entities');
     Mock::generate('OA_Dal_Maintenance_Priority');
     Mock::generate('OA_DB_Table_Priority');
 }
開發者ID:Jaree,項目名稱:revive-adserver,代碼行數:10,代碼來源:AllocateZoneImpressions.mtp.test.php

示例15: __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::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。