From c299a32ca9e74f374c31412bc5992f173e424a90 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Tue, 31 Jan 2017 13:33:38 +0100 Subject: [PATCH 1/5] Test more stuff --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index de35ef7f5..c6aabca78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,14 @@ language: php services: - mysql php: + - 5.6 - 7 env: matrix: - CORE_BRANCH=master DB=sqlite + - CORE_BRANCH=master DB=mysql - CORE_BRANCH=stable11 DB=sqlite + - CORE_BRANCH=stable11 DB=mysql before_install: # install core From b0dd73b811423c96ddb18e8a977514241ec37024 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Tue, 31 Jan 2017 13:39:25 +0100 Subject: [PATCH 2/5] Fix Entity for php 5.6 --- lib/Db/StackMapper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Db/StackMapper.php b/lib/Db/StackMapper.php index 0d1283f67..854767c63 100644 --- a/lib/Db/StackMapper.php +++ b/lib/Db/StackMapper.php @@ -23,7 +23,6 @@ namespace OCA\Deck\Db; -use OCP\AppFramework\Db\Entity; use OCP\IDBConnection; @@ -39,7 +38,7 @@ public function __construct(IDBConnection $db, CardMapper $cardMapper) { /** * @param $id - * @return Entity if not found + * @return \OCP\AppFramework\Db\Entity if not found */ public function find($id) { $sql = 'SELECT * FROM `*PREFIX*deck_stacks` ' . @@ -54,7 +53,7 @@ public function findAll($boardId, $limit = null, $offset = null) { } - public function delete(Entity $entity) { + public function delete(\OCP\AppFramework\Db\Entity $entity) { // delete cards on stack $this->cardMapper->deleteByStack($entity->getId()); return parent::delete($entity); From 6dc6f924cf148b5444d421d285ce98dea5d47109 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Tue, 31 Jan 2017 13:43:35 +0100 Subject: [PATCH 3/5] Rename to RelationalEntity to avoid naming collission --- lib/Db/Acl.php | 2 +- lib/Db/Board.php | 2 +- lib/Db/Card.php | 2 +- lib/Db/CardMapper.php | 2 +- lib/Db/Label.php | 2 +- lib/Db/{Entity.php => RelationalEntity.php} | 2 +- lib/Db/Stack.php | 2 +- lib/Db/StackMapper.php | 3 ++- tests/unit/Db/EntityTest.php | 4 ++-- 9 files changed, 11 insertions(+), 10 deletions(-) rename lib/Db/{Entity.php => RelationalEntity.php} (96%) diff --git a/lib/Db/Acl.php b/lib/Db/Acl.php index ea8570c9f..04be2ac4d 100644 --- a/lib/Db/Acl.php +++ b/lib/Db/Acl.php @@ -23,7 +23,7 @@ namespace OCA\Deck\Db; -class Acl extends Entity implements \JsonSerializable { +class Acl extends RelationalEntity implements \JsonSerializable { const PERMISSION_READ = 0; const PERMISSION_EDIT = 1; diff --git a/lib/Db/Board.php b/lib/Db/Board.php index 8a3c02d9e..4c8455439 100644 --- a/lib/Db/Board.php +++ b/lib/Db/Board.php @@ -25,7 +25,7 @@ use JsonSerializable; -class Board extends Entity implements JsonSerializable { +class Board extends RelationalEntity implements JsonSerializable { public $id; protected $title; diff --git a/lib/Db/Card.php b/lib/Db/Card.php index ed3046bc1..3c18f6ea1 100644 --- a/lib/Db/Card.php +++ b/lib/Db/Card.php @@ -26,7 +26,7 @@ use JsonSerializable; -class Card extends Entity implements JsonSerializable { +class Card extends RelationalEntity implements JsonSerializable { public $id; protected $title; diff --git a/lib/Db/CardMapper.php b/lib/Db/CardMapper.php index 9d71bb67c..961d77866 100644 --- a/lib/Db/CardMapper.php +++ b/lib/Db/CardMapper.php @@ -49,7 +49,7 @@ public function update(Entity $entity) { /** * @param $id - * @return Entity if not found + * @return RelationalEntity if not found */ public function find($id) { $sql = 'SELECT * FROM `*PREFIX*deck_cards` ' . diff --git a/lib/Db/Label.php b/lib/Db/Label.php index 6f8f9d09c..1e805ada8 100644 --- a/lib/Db/Label.php +++ b/lib/Db/Label.php @@ -26,7 +26,7 @@ use JsonSerializable; -class Label extends Entity implements JsonSerializable { +class Label extends RelationalEntity implements JsonSerializable { public $id; protected $title; diff --git a/lib/Db/Entity.php b/lib/Db/RelationalEntity.php similarity index 96% rename from lib/Db/Entity.php rename to lib/Db/RelationalEntity.php index eabc44aba..a2da98ba5 100644 --- a/lib/Db/Entity.php +++ b/lib/Db/RelationalEntity.php @@ -31,7 +31,7 @@ namespace OCA\Deck\Db; -class Entity extends \OCP\AppFramework\Db\Entity { +class RelationalEntity extends \OCP\AppFramework\Db\Entity { private $_relations = array(); diff --git a/lib/Db/Stack.php b/lib/Db/Stack.php index f987e5df5..4005284c7 100644 --- a/lib/Db/Stack.php +++ b/lib/Db/Stack.php @@ -26,7 +26,7 @@ use JsonSerializable; -class Stack extends Entity implements JsonSerializable { +class Stack extends RelationalEntity implements JsonSerializable { public $id; protected $title; diff --git a/lib/Db/StackMapper.php b/lib/Db/StackMapper.php index 854767c63..afb753ae4 100644 --- a/lib/Db/StackMapper.php +++ b/lib/Db/StackMapper.php @@ -23,6 +23,7 @@ namespace OCA\Deck\Db; +use OCP\AppFramework\Db\Entity; use OCP\IDBConnection; @@ -53,7 +54,7 @@ public function findAll($boardId, $limit = null, $offset = null) { } - public function delete(\OCP\AppFramework\Db\Entity $entity) { + public function delete(Entity $entity) { // delete cards on stack $this->cardMapper->deleteByStack($entity->getId()); return parent::delete($entity); diff --git a/tests/unit/Db/EntityTest.php b/tests/unit/Db/EntityTest.php index 195068899..251c28c07 100644 --- a/tests/unit/Db/EntityTest.php +++ b/tests/unit/Db/EntityTest.php @@ -26,7 +26,7 @@ class EntityTest extends \PHPUnit_Framework_TestCase { public function testRelation() { - $entity = new Entity(); + $entity = new RelationalEntity(); $entity->foo = null; $entity->addRelation('foo'); $entity->setFoo('test'); @@ -34,7 +34,7 @@ public function testRelation() { } public function testWithoutRelation() { - $entity = new Entity(); + $entity = new RelationalEntity(); $entity->foo = null; $entity->setFoo('test'); $this->assertEquals(['foo'=>true], $entity->getUpdatedFields()); From 7216c3b2eed6d1a89c9c4bee805c139047fa3054 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Tue, 31 Jan 2017 13:47:36 +0100 Subject: [PATCH 4/5] Use nextcloud travis script --- .travis.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index c6aabca78..cdf24b3f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,19 +12,14 @@ env: - CORE_BRANCH=stable11 DB=mysql before_install: - # install core - - cd ../ - - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH - - mv deck server/apps/deck - -before_script: - # fill owncloud with default configs and enable deck - - cd server - - mkdir data - - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass='' + - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh + - bash ./before_install.sh deck $CORE_BRANCH $DB + - cd ../server - ./occ app:enable deck - ./occ app:check-code deck - php -S localhost:8080 & + +before_script: - cd apps/deck script: From 1dbd8c9b7e5791a35a3accc198e5f9a3a6dd3c8e Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Tue, 31 Jan 2017 13:54:17 +0100 Subject: [PATCH 5/5] Update build status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae65580aa..5464843a2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Deck -[![Build Status](https://travis-ci.org/juliushaertl/deck.svg?token=6auunhHMRyx7p3n8fzxZ&branch=master)](https://travis-ci.org/juliushaertl/deck) [![CodeCov](https://codecov.io/github/juliushaertl/deck/coverage.svg?branch=master)](https://codecov.io/github/juliushaertl/deck) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/juliushaertl/deck/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/juliushaertl/deck/?branch=master) [![GitHub license](https://img.shields.io/badge/license-AGPLv3-blue.svg)](https://raw.githubusercontent.com/juliushaertl/deck/master/LICENSE) +[![Build Status](https://travis-ci.org/juliushaertl/deck.svg?branch=master)](https://travis-ci.org/juliushaertl/deck) [![CodeCov](https://codecov.io/github/juliushaertl/deck/coverage.svg?branch=master)](https://codecov.io/github/juliushaertl/deck) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/juliushaertl/deck/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/juliushaertl/deck/?branch=master) [![GitHub license](https://img.shields.io/badge/license-AGPLv3-blue.svg)](https://raw.githubusercontent.com/juliushaertl/deck/master/LICENSE) Deck is a kanban style project and personal management tool integrated with Nextcloud.