PHPUnit fixes for custom locations

This commit is contained in:
WolFi 2017-05-07 18:21:11 +02:00
parent c4f8439126
commit bb6c7a13b9
No known key found for this signature in database
GPG key ID: 7D15585354D072FF
2 changed files with 12 additions and 4 deletions

4
launch_phpunit.sh → launch_phpunit.sh.sample Executable file → Normal file
View file

@ -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

View file

@ -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"