From 6503a1c0a823e2f250a9d495f292bb54d18646f0 Mon Sep 17 00:00:00 2001 From: Piotr Mrowczynski Date: Wed, 28 Nov 2018 21:38:44 +0100 Subject: [PATCH] Refactor paths and fix travis --- .travis.yml | 2 ++ lib/{appconfig.php => Appconfig.php} | 0 lib/{db.php => DB.php} | 0 lib/{filter.php => Filter.php} | 0 lib/{helper.php => Helper.php} | 0 lib/{hookhandler.php => HookHandler.php} | 0 lib/{storage.php => Storage.php} | 0 .../{application.php => Application.php} | 0 ...tcontroller.php => DocumentController.php} | 18 +++----------- ...scontroller.php => SettingsController.php} | 0 lib/db/{storage.php => Storage.php} | 0 lib/db/{wopi.php => Wopi.php} | 0 .../DownloadResponse.php} | 2 +- lib/http/ResponseException.php | 24 +++++++++++++++++++ phpunit.xml | 2 +- ...pplicationtest.php => ApplicationTest.php} | 0 ...lertest.php => DocumentControllerTest.php} | 0 17 files changed, 31 insertions(+), 17 deletions(-) rename lib/{appconfig.php => Appconfig.php} (100%) rename lib/{db.php => DB.php} (100%) rename lib/{filter.php => Filter.php} (100%) rename lib/{helper.php => Helper.php} (100%) rename lib/{hookhandler.php => HookHandler.php} (100%) rename lib/{storage.php => Storage.php} (100%) rename lib/appinfo/{application.php => Application.php} (100%) rename lib/controller/{documentcontroller.php => DocumentController.php} (99%) rename lib/controller/{settingscontroller.php => SettingsController.php} (100%) rename lib/db/{storage.php => Storage.php} (100%) rename lib/db/{wopi.php => Wopi.php} (100%) rename lib/{downloadresponse.php => http/DownloadResponse.php} (99%) create mode 100644 lib/http/ResponseException.php rename tests/unit/appinfo/{applicationtest.php => ApplicationTest.php} (100%) rename tests/unit/controller/{documentcontrollertest.php => DocumentControllerTest.php} (100%) diff --git a/.travis.yml b/.travis.yml index 9bb70437f..87a432150 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,8 @@ sudo: true before_install: - wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh - bash ./before_install.sh richdocuments $CORE_BRANCH $DB + - cd ../core + - php occ app:enable $APP script: # Test lint diff --git a/lib/appconfig.php b/lib/Appconfig.php similarity index 100% rename from lib/appconfig.php rename to lib/Appconfig.php diff --git a/lib/db.php b/lib/DB.php similarity index 100% rename from lib/db.php rename to lib/DB.php diff --git a/lib/filter.php b/lib/Filter.php similarity index 100% rename from lib/filter.php rename to lib/Filter.php diff --git a/lib/helper.php b/lib/Helper.php similarity index 100% rename from lib/helper.php rename to lib/Helper.php diff --git a/lib/hookhandler.php b/lib/HookHandler.php similarity index 100% rename from lib/hookhandler.php rename to lib/HookHandler.php diff --git a/lib/storage.php b/lib/Storage.php similarity index 100% rename from lib/storage.php rename to lib/Storage.php diff --git a/lib/appinfo/application.php b/lib/appinfo/Application.php similarity index 100% rename from lib/appinfo/application.php rename to lib/appinfo/Application.php diff --git a/lib/controller/documentcontroller.php b/lib/controller/DocumentController.php similarity index 99% rename from lib/controller/documentcontroller.php rename to lib/controller/DocumentController.php index ed0db266b..2c5afc7d6 100644 --- a/lib/controller/documentcontroller.php +++ b/lib/controller/DocumentController.php @@ -13,7 +13,7 @@ use \OC\Files\View; use \OCP\AppFramework\Controller; -use OCP\Constants; +use \OCP\Constants; use \OCP\IRequest; use \OCP\IConfig; use \OCP\IL10N; @@ -28,20 +28,8 @@ use \OCA\Richdocuments\Db; use \OCA\Richdocuments\Helper; use \OCA\Richdocuments\Storage; -use \OCA\Richdocuments\DownloadResponse; - -class ResponseException extends \Exception { - private $hint; - - public function __construct($description, $hint = '') { - parent::__construct($description); - $this->hint = $hint; - } - - public function getHint() { - return $this->hint; - } -} +use \OCA\Richdocuments\Http\DownloadResponse; +use \OCA\Richdocuments\Http\ResponseException; class DocumentController extends Controller { diff --git a/lib/controller/settingscontroller.php b/lib/controller/SettingsController.php similarity index 100% rename from lib/controller/settingscontroller.php rename to lib/controller/SettingsController.php diff --git a/lib/db/storage.php b/lib/db/Storage.php similarity index 100% rename from lib/db/storage.php rename to lib/db/Storage.php diff --git a/lib/db/wopi.php b/lib/db/Wopi.php similarity index 100% rename from lib/db/wopi.php rename to lib/db/Wopi.php diff --git a/lib/downloadresponse.php b/lib/http/DownloadResponse.php similarity index 99% rename from lib/downloadresponse.php rename to lib/http/DownloadResponse.php index 01115b306..bcb5468dc 100644 --- a/lib/downloadresponse.php +++ b/lib/http/DownloadResponse.php @@ -9,7 +9,7 @@ * later. */ -namespace OCA\Richdocuments; +namespace OCA\Richdocuments\Http; use \OCP\AppFramework\Http; use \OCP\IRequest; diff --git a/lib/http/ResponseException.php b/lib/http/ResponseException.php new file mode 100644 index 000000000..93b14396a --- /dev/null +++ b/lib/http/ResponseException.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Piotr Mrowczynski + * + * This file is licensed under the Affero General Public License version 3 or + * later. + */ +namespace OCA\Richdocuments\Http; + +class ResponseException extends \Exception { + private $hint; + + public function __construct($description, $hint = '') { + parent::__construct($description); + $this->hint = $hint; + } + + public function getHint() { + return $this->hint; + } +} \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 341361550..d7138a805 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,7 +7,7 @@ timeoutForLargeTests="900" > - ./tests/unit + ./tests/unit diff --git a/tests/unit/appinfo/applicationtest.php b/tests/unit/appinfo/ApplicationTest.php similarity index 100% rename from tests/unit/appinfo/applicationtest.php rename to tests/unit/appinfo/ApplicationTest.php diff --git a/tests/unit/controller/documentcontrollertest.php b/tests/unit/controller/DocumentControllerTest.php similarity index 100% rename from tests/unit/controller/documentcontrollertest.php rename to tests/unit/controller/DocumentControllerTest.php