Merge pull request #7714 from owncloud/phpunit-config
Allow setting the config dir to use as enviroment variable for phpunit
This commit is contained in:
commit
4c8a83e82f
|
@ -98,7 +98,9 @@ class OC {
|
||||||
get_include_path()
|
get_include_path()
|
||||||
);
|
);
|
||||||
|
|
||||||
if(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
|
if(defined('PHPUNIT_CONFIG_DIR')) {
|
||||||
|
self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
|
||||||
|
} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
|
||||||
self::$configDir = OC::$SERVERROOT . '/tests/config/';
|
self::$configDir = OC::$SERVERROOT . '/tests/config/';
|
||||||
} else {
|
} else {
|
||||||
self::$configDir = OC::$SERVERROOT . '/config/';
|
self::$configDir = OC::$SERVERROOT . '/config/';
|
||||||
|
|
|
@ -3,9 +3,14 @@
|
||||||
|
|
||||||
define('PHPUNIT_RUN', 1);
|
define('PHPUNIT_RUN', 1);
|
||||||
|
|
||||||
require_once __DIR__.'/../lib/base.php';
|
$configDir = getenv('CONFIG_DIR');
|
||||||
|
if ($configDir) {
|
||||||
|
define('PHPUNIT_CONFIG_DIR', $configDir);
|
||||||
|
}
|
||||||
|
|
||||||
if(!class_exists('PHPUnit_Framework_TestCase')) {
|
require_once __DIR__ . '/../lib/base.php';
|
||||||
|
|
||||||
|
if (!class_exists('PHPUnit_Framework_TestCase')) {
|
||||||
require_once('PHPUnit/Autoload.php');
|
require_once('PHPUnit/Autoload.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue