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');
|
2014-02-27 12:12:28 +04:00
|
|
|
|
2014-02-27 12:11:19 +04:00
|
|
|
date_default_timezone_set('UTC');
|
2012-06-11 11:06:19 +04:00
|
|
|
|
2013-12-06 00:13:25 +04:00
|
|
|
if(getenv('TRAVIS'))
|
|
|
|
{
|
|
|
|
define('TESTING_ENVIRONMENT', 'TRAVIS');
|
2014-02-27 23:47:17 +04:00
|
|
|
define('TESTING_SERVER_HOST', '127.0.0.1');
|
2013-12-06 00:13:25 +04:00
|
|
|
}else{
|
|
|
|
define('TESTING_ENVIRONMENT', 'VAGRANT');
|
2014-02-27 23:47:17 +04:00
|
|
|
define('TESTING_SERVER_HOST', '172.31.1.2');
|
2013-12-06 01:50:36 +04:00
|
|
|
echo 'Initializing Environment using Vagrant' . PHP_EOL;
|
2014-02-27 12:11:19 +04:00
|
|
|
passthru('/bin/bash ' . __DIR__ . '/../vendor/tedivm/dovecottesting/SetupEnvironment.sh');
|
2013-12-06 01:50:36 +04:00
|
|
|
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
|
|
|
}
|