本文整理汇总了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('---');
}
示例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);
}
示例3:
function __construct()
{
parent::__construct();
$c = new Naf_UnitTestDbConnection();
$this->connection = $c->getConnection();
Naf_Table::setDefaultConnection($this->connection);
}
示例4: __construct
public function __construct()
{
$this->environ = new MongoTestEnvironment();
$this->environ->clean();
$this->save = array();
parent::__construct();
}
示例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;
}
示例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)));
}
示例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);
}
示例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));
}
示例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();
}
示例10:
function __construct()
{
require_once '../PelIfd.php';
require_once '../PelTag.php';
require_once '../PelEntryAscii.php';
parent::__construct('PEL IFD Tests');
}
示例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();
}
示例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'));
}
示例13:
function __construct()
{
parent::__construct('Kademlia Bucket Test');
$settings = new Kademlia\Settings();
$settings->own_node_id = Kademlia\Node::randomNodeId();
$this->settings = $settings;
}
示例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');
}
示例15: __construct
public function __construct($path)
{
$this->_path = $path;
$this->_parser = new HTMLPurifier_StringHashParser();
$this->_builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
parent::__construct($path);
}