Skip to content

Commit

Permalink
Refactor paths and fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
mrow4a committed Nov 28, 2018
1 parent 083f261 commit 434ac79
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 28 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ php:
env:
global:
- CORE_BRANCH=master
- APP_NAME=richdocuments
matrix:
- DB=sqlite

Expand All @@ -17,7 +18,9 @@ branches:
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
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../core
- php occ app:enable $APP_NAME

script:
# Test lint
Expand Down
5 changes: 1 addition & 4 deletions appinfo/app.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* ownCloud - Richdocuments App
*
Expand All @@ -21,11 +20,9 @@
*
*/

namespace OCA\Richdocuments\AppInfo;
use OCA\Richdocuments\AppInfo\Application;

$app = new Application();
$app->registerScripts();

\OCP\App::registerAdmin('richdocuments', 'admin');


File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/downloadresponse.php → lib/Http/DownloadResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* later.
*/

namespace OCA\Richdocuments;
namespace OCA\Richdocuments\Http;

use \OCP\AppFramework\Http;
use \OCP\IRequest;
Expand Down
24 changes: 24 additions & 0 deletions lib/Http/ResponseException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* ownCloud - Richdocuments App
*
* @author Piotr Mrowczynski <[email protected]>
* @copyright 2018 Piotr Mrowczynski <[email protected]>
*
* 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;
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
timeoutForLargeTests="900"
>
<testsuite name='unit'>
<directory suffix='test.php'>./tests/unit</directory>
<directory suffix='Test.php'>./tests/unit</directory>
</testsuite>
<!-- filters for code coverage -->
<filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
namespace OCA\Richdocuments\Tests\unit;
namespace OCA\Richdocuments\Tests\AppInfo;

use \OC_Hook;
use OCA\Richdocuments\AppInfo\Application;
Expand All @@ -18,7 +18,7 @@
*
* @group DB
*
* @package OCA\Richdocuments\Tests\Unit
* @package OCA\Richdocuments\Tests\AppInfo
*/
class ApplicationTest extends \Test\TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
namespace OCA\Richdocuments\Tests\unit;
namespace OCA\Richdocuments\Tests\Controller;

use \OCA\Richdocuments\Controller\DocumentController;
use \OCP\IRequest;
Expand All @@ -22,9 +22,9 @@
/**
* Class DocumentControllerTest
*
* @package OCA\Richdocuments\Tests\Unit
* @package OCA\Richdocuments\Tests\Controller
*/
class DocumentControllerTest extends \PHPUnit_Framework_TestCase {
class DocumentControllerTest extends \Test\TestCase {

/**
* @var IRequest
Expand All @@ -50,13 +50,13 @@ class DocumentControllerTest extends \PHPUnit_Framework_TestCase {
* @var ILogger
*/
private $logger;

/**
* @var Storage
*/
private $storage;

public function setUp(){
parent::setUp();
$this->request = $this->createMock(IRequest::class);
$this->settings = $this->createMock(IConfig::class);
$this->appConfig = $this->createMock(AppConfig::class);
Expand Down

0 comments on commit 434ac79

Please sign in to comment.