2012-06-11 11:06:19 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2012-06-11 11:39:12 +04:00
|
|
|
* This file is part of the Fetch library.
|
2012-06-11 11:06:19 +04:00
|
|
|
*
|
|
|
|
* (c) Robert Hafner <tedivm@tedivm.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2013-12-06 00:13:25 +04:00
|
|
|
error_reporting(-1);
|
|
|
|
|
2012-06-11 11:06:19 +04:00
|
|
|
define('TESTING', true);
|
2013-12-06 00:13:25 +04:00
|
|
|
define('TEST_USER', 'testuser');
|
|
|
|
define('TEST_PASSWORD', 'applesauce');
|
2012-06-11 11:06:19 +04:00
|
|
|
|
2013-12-06 00:13:25 +04:00
|
|
|
if(getenv('TRAVIS'))
|
|
|
|
{
|
|
|
|
define('TESTING_ENVIRONMENT', 'TRAVIS');
|
2013-12-06 01:50:36 +04:00
|
|
|
define('TESTING_SERVER_HOST', '127.0.0.1');
|
2013-12-06 00:13:25 +04:00
|
|
|
}else{
|
|
|
|
define('TESTING_ENVIRONMENT', 'VAGRANT');
|
2013-12-06 01:50:36 +04:00
|
|
|
define('TESTING_SERVER_HOST', '172.31.1.2');
|
|
|
|
echo 'Initializing Environment using Vagrant' . PHP_EOL;
|
|
|
|
passthru('/bin/bash ' . __DIR__ . '/SetupEnvironment.sh');
|
|
|
|
echo 'Environment Initialized' . PHP_EOL . PHP_EOL . PHP_EOL;
|
2013-12-06 00:13:25 +04:00
|
|
|
}
|
2012-06-11 11:06:19 +04:00
|
|
|
|
2013-12-05 11:34:08 +04:00
|
|
|
$filename = __DIR__ .'/../vendor/autoload.php';
|
|
|
|
|
|
|
|
if (!file_exists($filename)) {
|
|
|
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" . PHP_EOL;
|
|
|
|
echo " You need to execute `composer install` before running the tests. " . PHP_EOL;
|
|
|
|
echo " Vendors are required for complete test execution. " . PHP_EOL;
|
|
|
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" . PHP_EOL . PHP_EOL;
|
|
|
|
$filename = __DIR__ .'/../autoload.php';
|
|
|
|
require_once $filename;
|
|
|
|
}else{
|
|
|
|
$loader = require_once $filename;
|
|
|
|
$loader->add('Fetch\\Test', __DIR__);
|
2013-12-06 00:13:25 +04:00
|
|
|
}
|