From 2f41aa490f98f30d080714c4b29846643ae90558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Fri, 5 Dec 2014 17:11:38 +0100 Subject: [PATCH 1/3] fix travis-ci --- .travis.yml | 2 +- build.xml | 15 ++++++++++++ tests/autoloader.php | 52 ---------------------------------------- tests/unit/bootstrap.php | 12 ++++++++++ tests/unit/phpunit.xml | 27 +++++++++++++++++++++ 5 files changed, 55 insertions(+), 53 deletions(-) create mode 100644 build.xml delete mode 100644 tests/autoloader.php create mode 100644 tests/unit/bootstrap.php create mode 100644 tests/unit/phpunit.xml diff --git a/.travis.yml b/.travis.yml index 57a7d65..5a2dbc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ script: - sh -c "if [ '$DB' = 'sqlite' ]; then ant test; fi" # Run phpunit tests - - cd tests + - cd tests/unit - phpunit --configuration phpunit.xml # Create coverage report diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..2511643 --- /dev/null +++ b/build.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/tests/autoloader.php b/tests/autoloader.php deleted file mode 100644 index fd62085..0000000 --- a/tests/autoloader.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright Vincent Petry 2014 - */ - -require_once __DIR__ . '/../../../3rdparty/Pimple/Pimple.php'; - - -class OC { - public static $server; - public static $session; -} - -// to execute without owncloud, we need to create our own classloader -spl_autoload_register(function ($className){ - if (strpos($className, 'OCA\\') === 0) { - - $path = strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); - $relPath = __DIR__ . '/../..' . $path; - - if(file_exists($relPath)){ - require_once $relPath; - } - } else if(strpos($className, 'OCP\\') === 0) { - $path = strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); - $relPath = __DIR__ . '/../../../lib/public' . $path; - - if(file_exists($relPath)){ - require_once $relPath; - } - } else if(strpos($className, 'OC_') === 0) { - $path = strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); - $relPath = __DIR__ . '/../../../lib/private/' . $path; - - if(file_exists($relPath)){ - require_once $relPath; - } - } else if(strpos($className, 'OC\\') === 0) { - $path = strtolower(str_replace('\\', '/', substr($className, 2)) . '.php'); - $relPath = __DIR__ . '/../../../lib/private' . $path; - - if(file_exists($relPath)){ - require_once $relPath; - } - } -}); \ No newline at end of file diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php new file mode 100644 index 0000000..32b44b8 --- /dev/null +++ b/tests/unit/bootstrap.php @@ -0,0 +1,12 @@ + + + + . + + + + + ../../../metadata + + ../../../metadata/l10n + ../../../metadata/tests + + + + + + + + + From b2bc8981fb591ab703e35a9fdd04e98c36b62d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 7 Dec 2014 14:34:27 +0100 Subject: [PATCH 2/3] Add .scrutinizer.yml --- .scrutinizer.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..26c987a --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,12 @@ +filter: + excluded_paths: + - 'l10n/*' + - 'tests/*' + +imports: + - javascript + - php + +tools: + external_code_coverage: true + From b44fa5d0e0051efc83b1d8d3fa865ad0137065b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 8 Dec 2014 11:53:30 +0100 Subject: [PATCH 3/3] Update build.xml --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index 2511643..0ef079f 100644 --- a/build.xml +++ b/build.xml @@ -1,4 +1,4 @@ - +