当前位置: 首页>>代码示例>>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;未经允许,请勿转载。