Merge pull request #78 from nextcloud/fixPHPUnit

Fixed phpUnit at travis.
This commit is contained in:
Sander 2016-10-08 16:41:10 +02:00 committed by GitHub
commit 28a0e54a66
2 changed files with 17 additions and 4 deletions

View file

@ -63,11 +63,11 @@ script:
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '2' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi"
- cd apps/$APP_NAME/
#- php build/phpunit.phar -c phpunit.xml
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -c phpunit.xml --coverage-clover clover.xml; fi"
# Create coverage report
#- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
#- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi"
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi"
#- cd ../
- sh -c "if [ '$JSTESTS' = '1' ]; then grunt jshint; fi"

View file

@ -10,4 +10,17 @@
*/
require_once __DIR__ . '/../../../tests/bootstrap.php';
require_once __DIR__ . '/../appinfo/autoload.php';
require_once __DIR__ . '/../appinfo/autoload.php';
// Fix for "Autoload path not allowed: .../tests/lib/testcase.php"
\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
// Fix for "Autoload path not allowed: .../activity/tests/testcase.php"
\OC_App::loadApp('activity');
// Fix for "Autoload path not allowed: .../files/lib/activity.php"
\OC_App::loadApp('files');
// Fix for "Autoload path not allowed: .../files_sharing/lib/activity.php"
\OC_App::loadApp('files_sharing');
OC_Hook::clear();