Fix codacy errors

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-05-29 00:16:35 +02:00
parent 19a90809f9
commit 4623688852
6 changed files with 36 additions and 23 deletions

View File

@@ -67,7 +67,7 @@ pipeline:
matrix: matrix:
TESTS: syntax-php7.0 TESTS: syntax-php7.0
php5.6: php5.6:
image: nextcloudci/php5.6:php5.6-3 image: nextcloudci/php5.6:php5.6-7
environment: environment:
- APP_NAME=deck - APP_NAME=deck
- CORE_BRANCH=master - CORE_BRANCH=master
@@ -93,7 +93,7 @@ pipeline:
matrix: matrix:
TESTS: php5.6 TESTS: php5.6
php7.0: php7.0:
image: nextcloudci/php7.0:php7.0-7 image: nextcloudci/php7.0:php7.0-8
environment: environment:
- APP_NAME=deck - APP_NAME=deck
- CORE_BRANCH=master - CORE_BRANCH=master

View File

@@ -33,12 +33,12 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid
}); });
markdownItConverterProvider.use(markdownitLinkTarget); markdownItConverterProvider.use(markdownitLinkTarget);
$urlRouterProvider.otherwise("/"); $urlRouterProvider.otherwise('/');
$stateProvider $stateProvider
.state('list', { .state('list', {
url: "/:filter", url: '/:filter',
templateUrl: "/boardlist.mainView.html", templateUrl: '/boardlist.mainView.html',
controller: 'ListController', controller: 'ListController',
reloadOnSearch: false, reloadOnSearch: false,
params: { params: {
@@ -46,27 +46,27 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid
} }
}) })
.state('board', { .state('board', {
url: "/board/:boardId/:filter", url: '/board/:boardId/:filter',
templateUrl: "/board.html", templateUrl: '/board.html',
controller: 'BoardController', controller: 'BoardController',
params: { params: {
filter: { value: '', dynamic: true } filter: { value: '', dynamic: true }
} }
}) })
.state('board.detail', { .state('board.detail', {
url: "/detail/", url: '/detail/',
reloadOnSearch : false, reloadOnSearch : false,
views: { views: {
"sidebarView": { 'sidebarView': {
templateUrl: "/board.sidebarView.html" templateUrl: '/board.sidebarView.html'
} }
} }
}) })
.state('board.card', { .state('board.card', {
url: "/card/:cardId", url: '/card/:cardId',
views: { views: {
"sidebarView": { 'sidebarView': {
templateUrl: "/card.sidebarView.html", templateUrl: '/card.sidebarView.html',
controller: 'CardController' controller: 'CardController'
} }
} }

View File

@@ -1,4 +1,3 @@
/* /*
* @copyright Copyright (c) 2016 Julius Härtl <jus@bitgrid.net> * @copyright Copyright (c) 2016 Julius Härtl <jus@bitgrid.net>
* *
@@ -21,6 +20,8 @@
* *
*/ */
/* global app angular */
app.controller('ListController', function ($scope, $location, $filter, BoardService, $element, $timeout, $stateParams, $state) { app.controller('ListController', function ($scope, $location, $filter, BoardService, $element, $timeout, $stateParams, $state) {
$scope.boards = []; $scope.boards = [];
$scope.newBoard = {}; $scope.newBoard = {};
@@ -126,7 +127,7 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ
$scope.boardDeleteUndo = function (board) { $scope.boardDeleteUndo = function (board) {
BoardService.deleteUndo(board.id).then(function (data) { BoardService.deleteUndo(board.id).then(function (data) {
$scope.filterData(); $scope.filterData();
}) });
}; };
}); });

View File

@@ -24,7 +24,7 @@
/** /**
* @group DB * @group DB
*/ */
class BoardDatabaseTest extends \PHPUnit_Framework_TestCase class BoardDatabaseTest extends \Test\TestCase
{ {
const TEST_USER1 = "test-share-user1"; const TEST_USER1 = "test-share-user1";
const TEST_USER2 = "test-share-user2"; const TEST_USER2 = "test-share-user2";
@@ -61,6 +61,7 @@ class BoardDatabaseTest extends \PHPUnit_Framework_TestCase
\OC::$server->getGroupManager()->addBackend($groupBackend); \OC::$server->getGroupManager()->addBackend($groupBackend);
} }
public function setUp() { public function setUp() {
parent::setUp();
\OC::$server->getUserSession()->login(self::TEST_USER1, self::TEST_USER1); \OC::$server->getUserSession()->login(self::TEST_USER1, self::TEST_USER1);
$this->boardService = \OC::$server->query("\OCA\Deck\Service\BoardService"); $this->boardService = \OC::$server->query("\OCA\Deck\Service\BoardService");
} }
@@ -80,5 +81,6 @@ class BoardDatabaseTest extends \PHPUnit_Framework_TestCase
} }
public function tearDown() { public function tearDown() {
parent::tearDown();
} }
} }

View File

@@ -107,7 +107,10 @@ class BoardMapperTest extends MapperTestUtility {
public function testFind() { public function testFind() {
$actual = $this->boardMapper->find($this->boards[0]->getId()); $actual = $this->boardMapper->find($this->boards[0]->getId());
$expected = $this->boards[0]; /** @var Board $expected */
$expected = clone $this->boards[0];
$expected->setShared(-1);
$expected->resetUpdatedFields();
$this->assertEquals($expected, $actual); $this->assertEquals($expected, $actual);
} }
@@ -129,9 +132,9 @@ class BoardMapperTest extends MapperTestUtility {
public function testFindAll() { public function testFindAll() {
$actual = $this->boardMapper->findAll(); $actual = $this->boardMapper->findAll();
$this->assertAttributeEquals($this->boards[0]->getId(), 'id', $actual[0]); $this->assertEquals($this->boards[0]->getId(), $actual[0]->getId());
$this->assertAttributeEquals($this->boards[1]->getId(), 'id', $actual[1]); $this->assertEquals($this->boards[1]->getId(), $actual[1]->getId());
$this->assertAttributeEquals($this->boards[2]->getId(), 'id', $actual[2]); $this->assertEquals($this->boards[2]->getId(), $actual[2]->getId());
} }
public function testFindAllToDelete() { public function testFindAllToDelete() {
@@ -148,8 +151,9 @@ class BoardMapperTest extends MapperTestUtility {
public function testFindWithLabels() { public function testFindWithLabels() {
$actual = $this->boardMapper->find($this->boards[0]->getId(), true, false); $actual = $this->boardMapper->find($this->boards[0]->getId(), true, false);
$expected = $this->boards[0]; /** @var Board $expected */
$this->assertEquals($expected, $actual); $expected = $this->boards[0];
$this->assertEquals($expected->getLabels(), $actual->getLabels());
} }
public function testFindWithAcl() { public function testFindWithAcl() {

View File

@@ -31,8 +31,14 @@ use OCA\Deck\Db\Label;
use OCA\Deck\Db\LabelMapper; use OCA\Deck\Db\LabelMapper;
use OCA\Deck\Db\Stack; use OCA\Deck\Db\Stack;
use OCA\Deck\Db\StackMapper; use OCA\Deck\Db\StackMapper;
use Test\TestCase; use \Test\TestCase;
/**
* Class StackServiceTest
*
* @package OCA\Deck\Service
* @group DB
*/
class StackServiceTest extends TestCase { class StackServiceTest extends TestCase {
/** @var StackService */ /** @var StackService */