コード例 #1
0
 function __construct()
 {
     parent::__construct();
     // pseudo-default value
     // php quirks - static class members are not reset after each test.
     Config::setIdSeparator('---');
 }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: Abstract.php プロジェクト: BackupTheBerlios/naf-svn
 function __construct()
 {
     parent::__construct();
     $c = new Naf_UnitTestDbConnection();
     $this->connection = $c->getConnection();
     Naf_Table::setDefaultConnection($this->connection);
 }
コード例 #4
0
 public function __construct()
 {
     $this->environ = new MongoTestEnvironment();
     $this->environ->clean();
     $this->save = array();
     parent::__construct();
 }
コード例 #5
0
ファイル: adapter_test.php プロジェクト: hepplerj/Scripto
 /**
  * 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
0
ファイル: tests.php プロジェクト: rchicoria/epp-drs
 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
0
ファイル: testSpec.php プロジェクト: sebcode/proust
 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
0
 /**
  * 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();
 }
コード例 #10
0
ファイル: ifd.php プロジェクト: BackupTheBerlios/pic2base-svn
 function __construct()
 {
     require_once '../PelIfd.php';
     require_once '../PelTag.php';
     require_once '../PelEntryAscii.php';
     parent::__construct('PEL IFD Tests');
 }
コード例 #11
0
 /**
  * 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
0
 /**
  * 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
0
 function __construct()
 {
     parent::__construct('Kademlia Bucket Test');
     $settings = new Kademlia\Settings();
     $settings->own_node_id = Kademlia\Node::randomNodeId();
     $this->settings = $settings;
 }
コード例 #14
0
 /**
  * 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
0
 public function __construct($path)
 {
     $this->_path = $path;
     $this->_parser = new HTMLPurifier_StringHashParser();
     $this->_builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
     parent::__construct($path);
 }
コード例 #16
0
 function __construct()
 {
     parent::__construct();
     $this->dir = 'tmp/' . md5(uniqid(rand(), true)) . '/';
     mkdir($this->dir);
     $this->oldDir = getcwd();
 }
コード例 #17
0
ファイル: test_http.php プロジェクト: rongzedong/kademlia.php
 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']]]);
 }
コード例 #18
0
 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');
             }
         }
     }
 }
コード例 #19
0
 /**
  * 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());
 }
コード例 #20
0
 /**
  * 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'));
 }
コード例 #21
0
 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);
 }
コード例 #22
0
 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');
 }
コード例 #23
0
ファイル: spec.php プロジェクト: herlambang/h2o-php
 function __construct($label = false)
 {
     if (!$label) {
         $label = str_replace(array('Describe_', '_'), array('', ' '), get_class($this));
     }
     $this->matcher = new SpecMatcher($this);
     parent::__construct($label);
 }
コード例 #24
0
 function __construct($schemaName = null)
 {
     parent::__construct();
     if (!isset($schemaName)) {
         return;
     }
     $this->validator = new \Hypercharge\JsonSchemaValidator($schemaName);
 }
コード例 #25
0
 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')));
 }
コード例 #26
0
 function __construct()
 {
     parent::__construct('Kademlia Node List Test');
     $this->node_array = [];
     for ($i = 0; $i < 20; $i++) {
         array_push($this->node_array, KademliaTestFactory::constructNode());
     }
 }
コード例 #27
0
 /**
  * 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'));
 }
コード例 #28
0
 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')));
 }
コード例 #29
0
 /**
  * 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();
 }