Skip to content
Snippets Groups Projects
Commit 4c8a83e8 authored by Robin Appelman's avatar Robin Appelman
Browse files

Merge pull request #7714 from owncloud/phpunit-config

Allow setting the config dir to use as enviroment variable for phpunit
parents abdc823b a8eb7a50
No related branches found
No related tags found
No related merge requests found
...@@ -98,7 +98,9 @@ class OC { ...@@ -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,6 +3,11 @@ ...@@ -3,6 +3,11 @@
define('PHPUNIT_RUN', 1); define('PHPUNIT_RUN', 1);
$configDir = getenv('CONFIG_DIR');
if ($configDir) {
define('PHPUNIT_CONFIG_DIR', $configDir);
}
require_once __DIR__ . '/../lib/base.php'; require_once __DIR__ . '/../lib/base.php';
if (!class_exists('PHPUnit_Framework_TestCase')) { if (!class_exists('PHPUnit_Framework_TestCase')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment