Added support for bootstrapping variables in unit tests.
This commit is contained in:
@@ -57,15 +57,23 @@ class TestCase extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
//public function __construct(score $score = NULL, locale $locale = NULL, adapter $adapter = NULL) {
|
||||
public static function setUpBeforeClass() {
|
||||
global $bootstrap_settings;
|
||||
|
||||
if (!isset($bootstrap_settings)) {
|
||||
$bootstrap_settings = array();
|
||||
}
|
||||
self::$settings = $bootstrap_settings;
|
||||
|
||||
|
||||
//$this->setTestNamespace('Tests\Units');
|
||||
if (file_exists('test/settings.ini')) {
|
||||
self::$settings = parse_ini_file('test/settings.ini');
|
||||
self::$settings += parse_ini_file('test/settings.ini');
|
||||
}
|
||||
else {
|
||||
throw new Exception('Could not access test/settings.ini');
|
||||
}
|
||||
|
||||
|
||||
\HPCloud\Bootstrap::useAutoloader();
|
||||
\HPCloud\Bootstrap::setConfiguration(self::$settings);
|
||||
|
||||
|
||||
10
test/bootstrap_curl.php
Normal file
10
test/bootstrap_curl.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Helpers for testing using the CurlTransport.
|
||||
*/
|
||||
|
||||
$bootstrap_settings = array(
|
||||
'transport' => '\HPCloud\Transport\CURLTransport',
|
||||
);
|
||||
10
test/bootstrap_phpstream.php
Normal file
10
test/bootstrap_phpstream.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Helpers for testing using the CurlTransport.
|
||||
*/
|
||||
|
||||
$bootstrap_settings = array(
|
||||
'transport' => '\HPCloud\Transport\PHPStreamTransport',
|
||||
);
|
||||
Reference in New Issue
Block a user