function __construct() { parent::__construct(); // pseudo-default value // php quirks - static class members are not reset after each test. Config::setIdSeparator('---'); }
function __construct() { parent::__construct(); $username = '******'; $password = '******'; $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); }
function __construct() { parent::__construct(); $c = new Naf_UnitTestDbConnection(); $this->connection = $c->getConnection(); Naf_Table::setDefaultConnection($this->connection); }
public function __construct() { $this->environ = new MongoTestEnvironment(); $this->environ->clean(); $this->save = array(); parent::__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; }
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))); }
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); }
/** * 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)); }
/** * 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(); }
function __construct() { require_once '../PelIfd.php'; require_once '../PelTag.php'; require_once '../PelEntryAscii.php'; parent::__construct('PEL IFD Tests'); }
/** * The constructor method. */ function __construct() { $oServiceLocator =& OA_ServiceLocator::instance(); $oNow = new Date('2008-04-01 12:30:00'); $oServiceLocator->register('now', $oNow); parent::__construct(); }
/** * 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')); }
function __construct() { parent::__construct('Kademlia Bucket Test'); $settings = new Kademlia\Settings(); $settings->own_node_id = Kademlia\Node::randomNodeId(); $this->settings = $settings; }
/** * The constructor method. */ function __construct() { parent::__construct(); Mock::generate('MAX_Dal_Entities'); Mock::generate('OA_Dal_Maintenance_Priority'); Mock::generate('OA_DB_Table_Priority'); }
public function __construct($path) { $this->_path = $path; $this->_parser = new HTMLPurifier_StringHashParser(); $this->_builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); parent::__construct($path); }
function __construct() { parent::__construct(); $this->dir = 'tmp/' . md5(uniqid(rand(), true)) . '/'; mkdir($this->dir); $this->oldDir = getcwd(); }
function __construct() { parent::__construct('Kademlia HTTP Test'); return; ############################# $this->node = KademliaTestFactory::constructNode(['protocols' => [Kademlia\Http::protocol_id => ['protocol' => 'http', 'host' => '10.0.0.1', 'port' => 8080, 'path' => '/kad/kademlia']]]); }
function __construct($name = 'Codendi_File test') { parent::__construct($name); $this->small_file = dirname(__FILE__) . '/_fixtures/small_file'; $this->big_file = dirname(__FILE__) . '/_fixtures/big_file'; $this->test_big_files = true; $realpath = $this->big_file; if (is_link($this->big_file)) { $realpath = readlink($this->big_file); } if (!file_exists($realpath) || @filesize($realpath) === 0) { //save same ci time, create the big file only once touch($realpath); if (!file_exists($realpath)) { $this->test_big_files = false; trigger_error("Unable to create {$this->big_file}. Cannot test big files.", E_USER_WARNING); } else { if (`df {$realpath} | tail -1 | awk '{print \$4}'` < 4200000) { unlink($realpath); $this->test_big_files = false; trigger_error("No sufficient space to create {$this->big_file}. Cannot test big files. Tip: link the file to a partition with more than 4Gb available.", E_USER_WARNING); } else { exec('dd if=/dev/zero of=' . $realpath . ' bs=1M count=4000'); } } } }
/** * 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()); }
/** * The constructor method. */ function __construct() { parent::__construct(); Mock::generate('OA_Dal_Maintenance_Priority', $this->mockDal = 'MockOA_Dal_Maintenance_Priority' . rand()); Mock::generate('MAX_Dal_Admin_Data_intermediate_ad', $this->mockDalIntermediateAd = 'MAX_Dal_Admin_Data_intermediate_ad' . rand()); Mock::generatePartial('OA_Maintenance_Priority_AdServer_Task_ECPMforRemnant', 'PartialMock_OA_Maintenance_Priority_AdServer_Task_ECPMforRemnant', array('_getDal', '_factoryDal', 'getTodaysRemainingOperationIntervals', 'calculateCampaignEcpm')); }
function __construct() { parent::__construct(); $html = file_get_contents(dirname(__FILE__) . '/support/dom_tester.html'); $this->dom = new DomDocument('1.0', 'utf-8'); $this->dom->validateOnParse = true; $this->dom->loadHTML($html); }
public function __construct() { parent::__construct('PHP_Merchant_Paypal_Express_Checkout test cases'); $this->token = 'EC-6L77249383950130E'; // options to pass to the merchant class $this->setup_purchase_options = $this->purchase_options = array('return_url' => 'http://example.com/return', 'cancel_url' => 'http://example.com/cancel', 'address_override' => true, 'shipping_address' => array('name' => 'Gary Cao', 'street' => '1 Infinite Loop', 'street2' => 'Apple Headquarter', 'city' => 'Cupertino', 'state' => 'CA', 'country' => 'USA', 'zip' => '95014', 'phone' => '(877) 412-7753'), 'currency' => 'JPY', 'amount' => 15337, 'subtotal' => 13700, 'shipping' => 1500, 'tax' => 137, 'description' => 'Order for example.com', 'invoice' => 'E84A90G94', 'notify_url' => 'http://example.com/ipn', 'items' => array(array('name' => 'Gold Cart Plugin', 'description' => 'Gold Cart extends your WP eCommerce store by enabling additional features and functionality, including views, galleries, store search and payment gateways.', 'amount' => 4000, 'quantity' => 1, 'tax' => 40, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/gold-cart-plugin/'), array('name' => 'Member Access Plugin', 'description' => 'Create pay to view subscription sites', 'amount' => 5000, 'quantity' => 1, 'tax' => 50, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/member-access-plugin/'), array('name' => 'Amazon S3', 'description' => 'This Plugin allows downloadable products that you have for sale on your WP eCommerce site to be hosted within Amazon S3.', 'amount' => 4700, 'quantity' => 1, 'tax' => 47, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/amazon-s3-plugin/'))); $this->purchase_options += array('token' => 'EC-2JJ0893331633543K', 'payer_id' => 'BC798KQ2QU22W'); }
function __construct($label = false) { if (!$label) { $label = str_replace(array('Describe_', '_'), array('', ' '), get_class($this)); } $this->matcher = new SpecMatcher($this); parent::__construct($label); }
function __construct($schemaName = null) { parent::__construct(); if (!isset($schemaName)) { return; } $this->validator = new \Hypercharge\JsonSchemaValidator($schemaName); }
public function __construct() { parent::__construct('PHP_Merchant_Paypal_Pro test cases'); // Generate an invoice number $inv = 'E84A90G' . mt_rand(100, 999); // Common Options $this->default_options = array('paymentaction' => 'sale', 'template' => 'templateD', 'vendor' => '*****@*****.**', 'return_url' => 'http://example.com/return', 'cancel_url' => 'http://example.com/cancel', 'address_override' => 1, 'currency' => 'USD', 'amount' => 15.337, 'subtotal' => 13.7, 'shipping' => 1.5, 'tax' => 0.137, 'description' => 'A sample order', 'invoice' => $inv, 'notify_url' => 'http://example.com/ipn', 'shipping_address' => array('name' => 'Abid Omar', 'street' => '1 Infinite Loop', 'street2' => 'Apple Headquarter ext', 'city' => 'Cupertino', 'state' => 'CA', 'country' => 'US', 'zip' => '95014', 'phone' => '(877) 412-7753'), 'items' => array(array('name' => 'Gold Cart Plugin', 'description' => 'Gold Cart extends your WP eCommerce store by enabling additional features and functionality.', 'amount' => 4, 'quantity' => 1, 'tax' => 0.04, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/gold-cart-plugin/', 'number' => '7A12343-WHT-XL'), array('name' => 'Member Access Plugin', 'description' => 'Create pay to view subscription sites', 'amount' => 5, 'quantity' => 1, 'tax' => 0.05, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/member-access-plugin/', 'number' => '7A12344-WHT-XL'), array('name' => 'Amazon S3', 'description' => 'This Plugin allows downloadable products that you have for sale on your WP eCommerce site to be hosted within Amazon S3.', 'amount' => 4.7, 'quantity' => 1, 'tax' => 0.047, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/amazon-s3-plugin/', 'number' => '7A12345-WHT-XL'))); }
function __construct() { parent::__construct('Kademlia Node List Test'); $this->node_array = []; for ($i = 0; $i < 20; $i++) { array_push($this->node_array, KademliaTestFactory::constructNode()); } }
/** * The constructor method. */ function __construct() { parent::__construct(); // Mock the OA_DB class Mock::generate('OA_DB'); // Partially mock the OA_DB_Table class Mock::generatePartial('OA_DB_Table', 'PartialMockOA_DB_Table', array('_getDbConnection')); }
public function __construct() { parent::__construct('PHP_Merchant_Paypal_Express_Checkout test cases'); // Generate an invoice number $inv = 'E84A90G' . mt_rand(100, 999); // Common Options $this->default_options = array('return_url' => 'http://example.com/return', 'cancel_url' => 'http://example.com/cancel', 'address_override' => 1, 'currency' => 'USD', 'amount' => 15.337, 'subtotal' => 13.7, 'shipping' => 1.5, 'tax' => 0.137, 'description' => 'A sample order', 'invoice' => $inv, 'notify_url' => 'http://example.com/ipn', 'items' => array(array('name' => 'Gold Cart Plugin', 'description' => 'Gold Cart extends your WP eCommerce store by enabling additional features and functionality.', 'amount' => 4, 'quantity' => 1, 'tax' => 0.04, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/gold-cart-plugin/', 'number' => '7A12343-WHT-XL'), array('name' => 'Member Access Plugin', 'description' => 'Create pay to view subscription sites', 'amount' => 5, 'quantity' => 1, 'tax' => 0.05, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/member-access-plugin/', 'number' => '7A12344-WHT-XL'), array('name' => 'Amazon S3', 'description' => 'This Plugin allows downloadable products that you have for sale on your WP eCommerce site to be hosted within Amazon S3.', 'amount' => 4.7, 'quantity' => 1, 'tax' => 0.047, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/amazon-s3-plugin/', 'number' => '7A12345-WHT-XL'))); }
/** * The constructor method. */ function __construct() { parent::__construct(); // Make sure we don't get a Status: header, but a HTTP/1.0 instead $GLOBALS['_MAX']['CONF']['delivery']['cgiForceStatusHeader'] = false; $_SERVER["SERVER_PROTOCOL"] = 'HTTP/1.0'; MAX_Dal_Delivery_Include(); }
/** * The constructor method. */ function __construct() { parent::__construct(); // Prepare the database connection for use in the tests $this->oDbh = OA_DB::singleton(); // Prepare the MSE DAL for use in the tests $oFactory = new OX_Dal_Maintenance_Statistics_Factory(); $this->oDal = $oFactory->factory(); }