From bb6c7a13b9d1b8e87dfc5a8f4495b9eb9319fa2c Mon Sep 17 00:00:00 2001 From: WolFi Date: Sun, 7 May 2017 18:21:11 +0200 Subject: [PATCH] PHPUnit fixes for custom locations --- launch_phpunit.sh => launch_phpunit.sh.sample | 4 ++-- tests/bootstrap.php | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) rename launch_phpunit.sh => launch_phpunit.sh.sample (55%) mode change 100755 => 100644 diff --git a/launch_phpunit.sh b/launch_phpunit.sh.sample old mode 100755 new mode 100644 similarity index 55% rename from launch_phpunit.sh rename to launch_phpunit.sh.sample index 70d80b58..949113d7 --- a/launch_phpunit.sh +++ b/launch_phpunit.sh.sample @@ -1,7 +1,7 @@ #!/bin/bash # Setup your testing environment paths -export SERVER_BASE_DIR=/var/www/html/nextcloud/ -export SERVER_CONFIG_DIR=/var/www/html/nextcloud/config/ +export SERVER_BASE_DIR=/var/www/html/ +export SERVER_CONFIG_DIR=/var/www/html/config/ export SERVER_CONFIG_FILE=config.php # Launch the actual tests diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 5bee8f49..f9408862 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,9 +9,17 @@ * @copyright Sander Brand 2016 */ -require_once __DIR__ . '/../../../tests/bootstrap.php'; +$nc_require_base = getenv('SERVER_BASE_DIR'); + +if ($nc_require_base) { + require_once $nc_require_base . '/tests/bootstrap.php'; +} +else{ + require_once __DIR__ . '/../../../tests/bootstrap.php'; +} + require_once __DIR__ . '/../appinfo/autoload.php'; -#require_once __DIR__ . '/db/DatabaseHelperTest.php'; +require_once __DIR__ . '/db/DatabaseHelperTest.php'; // Fix for "Autoload path not allowed: .../tests/lib/testcase.php"