diff --git a/.drone.yml b/.drone.yml index d57d9fc1f..537397709 100644 --- a/.drone.yml +++ b/.drone.yml @@ -67,7 +67,7 @@ pipeline: matrix: TESTS: syntax-php7.0 php5.6: - image: nextcloudci/php5.6:php5.6-3 + image: nextcloudci/php5.6:php5.6-7 environment: - APP_NAME=deck - CORE_BRANCH=master @@ -93,7 +93,7 @@ pipeline: matrix: TESTS: php5.6 php7.0: - image: nextcloudci/php7.0:php7.0-7 + image: nextcloudci/php7.0:php7.0-8 environment: - APP_NAME=deck - CORE_BRANCH=master diff --git a/js/app/Config.js b/js/app/Config.js index 68cfcb471..f1330ddb3 100644 --- a/js/app/Config.js +++ b/js/app/Config.js @@ -33,12 +33,12 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid }); markdownItConverterProvider.use(markdownitLinkTarget); - $urlRouterProvider.otherwise("/"); + $urlRouterProvider.otherwise('/'); $stateProvider .state('list', { - url: "/:filter", - templateUrl: "/boardlist.mainView.html", + url: '/:filter', + templateUrl: '/boardlist.mainView.html', controller: 'ListController', reloadOnSearch: false, params: { @@ -46,27 +46,27 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid } }) .state('board', { - url: "/board/:boardId/:filter", - templateUrl: "/board.html", + url: '/board/:boardId/:filter', + templateUrl: '/board.html', controller: 'BoardController', params: { filter: { value: '', dynamic: true } } }) .state('board.detail', { - url: "/detail/", + url: '/detail/', reloadOnSearch : false, views: { - "sidebarView": { - templateUrl: "/board.sidebarView.html" + 'sidebarView': { + templateUrl: '/board.sidebarView.html' } } }) .state('board.card', { - url: "/card/:cardId", + url: '/card/:cardId', views: { - "sidebarView": { - templateUrl: "/card.sidebarView.html", + 'sidebarView': { + templateUrl: '/card.sidebarView.html', controller: 'CardController' } } diff --git a/js/controller/ListController.js b/js/controller/ListController.js index dde09e548..c4b76388e 100644 --- a/js/controller/ListController.js +++ b/js/controller/ListController.js @@ -1,4 +1,3 @@ - /* * @copyright Copyright (c) 2016 Julius Härtl * @@ -21,6 +20,8 @@ * */ +/* global app angular */ + app.controller('ListController', function ($scope, $location, $filter, BoardService, $element, $timeout, $stateParams, $state) { $scope.boards = []; $scope.newBoard = {}; @@ -126,7 +127,7 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ $scope.boardDeleteUndo = function (board) { BoardService.deleteUndo(board.id).then(function (data) { $scope.filterData(); - }) + }); }; }); diff --git a/tests/integration/database/BoardDatabaseTest.php b/tests/integration/database/BoardDatabaseTest.php index f0df9e7bd..f812aef11 100644 --- a/tests/integration/database/BoardDatabaseTest.php +++ b/tests/integration/database/BoardDatabaseTest.php @@ -24,7 +24,7 @@ /** * @group DB */ -class BoardDatabaseTest extends \PHPUnit_Framework_TestCase +class BoardDatabaseTest extends \Test\TestCase { const TEST_USER1 = "test-share-user1"; const TEST_USER2 = "test-share-user2"; @@ -61,6 +61,7 @@ class BoardDatabaseTest extends \PHPUnit_Framework_TestCase \OC::$server->getGroupManager()->addBackend($groupBackend); } public function setUp() { + parent::setUp(); \OC::$server->getUserSession()->login(self::TEST_USER1, self::TEST_USER1); $this->boardService = \OC::$server->query("\OCA\Deck\Service\BoardService"); } @@ -80,5 +81,6 @@ class BoardDatabaseTest extends \PHPUnit_Framework_TestCase } public function tearDown() { + parent::tearDown(); } } \ No newline at end of file diff --git a/tests/unit/Db/BoardMapperTest.php b/tests/unit/Db/BoardMapperTest.php index d7b06a609..ab865b1fb 100644 --- a/tests/unit/Db/BoardMapperTest.php +++ b/tests/unit/Db/BoardMapperTest.php @@ -107,7 +107,10 @@ class BoardMapperTest extends MapperTestUtility { public function testFind() { $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); } @@ -129,9 +132,9 @@ class BoardMapperTest extends MapperTestUtility { public function testFindAll() { $actual = $this->boardMapper->findAll(); - $this->assertAttributeEquals($this->boards[0]->getId(), 'id', $actual[0]); - $this->assertAttributeEquals($this->boards[1]->getId(), 'id', $actual[1]); - $this->assertAttributeEquals($this->boards[2]->getId(), 'id', $actual[2]); + $this->assertEquals($this->boards[0]->getId(), $actual[0]->getId()); + $this->assertEquals($this->boards[1]->getId(), $actual[1]->getId()); + $this->assertEquals($this->boards[2]->getId(), $actual[2]->getId()); } public function testFindAllToDelete() { @@ -148,8 +151,9 @@ class BoardMapperTest extends MapperTestUtility { public function testFindWithLabels() { $actual = $this->boardMapper->find($this->boards[0]->getId(), true, false); - $expected = $this->boards[0]; - $this->assertEquals($expected, $actual); + /** @var Board $expected */ + $expected = $this->boards[0]; + $this->assertEquals($expected->getLabels(), $actual->getLabels()); } public function testFindWithAcl() { diff --git a/tests/unit/Service/StackServiceTest.php b/tests/unit/Service/StackServiceTest.php index fc15e3b7e..f262deced 100644 --- a/tests/unit/Service/StackServiceTest.php +++ b/tests/unit/Service/StackServiceTest.php @@ -31,8 +31,14 @@ use OCA\Deck\Db\Label; use OCA\Deck\Db\LabelMapper; use OCA\Deck\Db\Stack; use OCA\Deck\Db\StackMapper; -use Test\TestCase; +use \Test\TestCase; +/** + * Class StackServiceTest + * + * @package OCA\Deck\Service + * @group DB + */ class StackServiceTest extends TestCase { /** @var StackService */