Unit test changes and CI updates

This commit is contained in:
Matthew Ross 2018-03-21 21:53:32 -04:00
parent 9b7120de09
commit ebf2b556fa
16 changed files with 527 additions and 218 deletions

View File

@ -1,14 +1,13 @@
language: php
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
before_script:
- nvm install 6
- nvm use 6
- npm i -g npm@4
- npm i -g @angular/cli
- npm i
- touch tests.db
- chmod a+w tests.db

View File

@ -10,7 +10,7 @@ The goal of TaskBoard is to provide a simple and clean interface to a functional
### Prerequisites
A web server running PHP 5.6, or 7.x with sqlite enabled.
A web server running PHP 7.x with sqlite enabled (it may work on PHP 5.6, but is not supported).
The server must have `sqlite3` and `php7-sqlite` (or `php5-sqlite`) installed.

View File

@ -5,7 +5,7 @@
"slim/slim": "^3.3",
"firebase/php-jwt": "^5.0",
"phpmailer/phpmailer": "^6.0",
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": "^6.0",
"myclabs/php-enum": "^1.5"
},
"license": "MIT",

498
src/api/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "af5cc95a786c370fb6ed26c76beb770c",
"content-hash": "14e8b3dd5cae40acf67c37c5f168bf4c",
"packages": [
{
"name": "container-interop/container-interop",
@ -39,32 +39,32 @@
},
{
"name": "doctrine/instantiator",
"version": "1.0.5",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"shasum": ""
},
"require": {
"php": ">=5.3,<8.0-DEV"
"php": "^7.1"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.0"
"phpunit/phpunit": "^6.2.3",
"squizlabs/php_codesniffer": "^3.0.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.2.x-dev"
}
},
"autoload": {
@ -89,7 +89,7 @@
"constructor",
"instantiate"
],
"time": "2015-06-14T21:17:01+00:00"
"time": "2017-07-22T11:58:36+00:00"
},
{
"name": "firebase/php-jwt",
@ -391,6 +391,108 @@
],
"time": "2018-02-13T20:26:39+00:00"
},
{
"name": "phar-io/manifest",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/manifest.git",
"reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0",
"reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-phar": "*",
"phar-io/version": "^1.0.1",
"php": "^5.6 || ^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
},
{
"name": "Sebastian Heuer",
"email": "sebastian@phpeople.de",
"role": "Developer"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "Developer"
}
],
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
"time": "2017-03-05T18:14:27+00:00"
},
{
"name": "phar-io/version",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
"reference": "a70c0ced4be299a63d32fa96d9281d03e94041df"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df",
"reference": "a70c0ced4be299a63d32fa96d9281d03e94041df",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
},
{
"name": "Sebastian Heuer",
"email": "sebastian@phpeople.de",
"role": "Developer"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "Developer"
}
],
"description": "Library for handling version information and constraints",
"time": "2017-03-05T17:38:23+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
@ -447,29 +549,35 @@
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "3.3.2",
"version": "4.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2"
"reference": "94fd0001232e47129dd3504189fa1c7225010d08"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2",
"reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
"reference": "94fd0001232e47129dd3504189fa1c7225010d08",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.0",
"phpdocumentor/reflection-common": "^1.0.0",
"phpdocumentor/type-resolver": "^0.4.0",
"webmozart/assert": "^1.0"
},
"require-dev": {
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "^4.4"
"doctrine/instantiator": "~1.0.5",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^6.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
@ -488,7 +596,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2017-11-10T14:09:06+00:00"
"time": "2017-11-30T07:14:17+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@ -668,40 +776,40 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "4.0.8",
"version": "5.3.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
"reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
"reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1",
"reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-xmlwriter": "*",
"php": "^5.6 || ^7.0",
"phpunit/php-file-iterator": "^1.3",
"phpunit/php-text-template": "^1.2",
"phpunit/php-token-stream": "^1.4.2 || ^2.0",
"sebastian/code-unit-reverse-lookup": "^1.0",
"sebastian/environment": "^1.3.2 || ^2.0",
"sebastian/version": "^1.0 || ^2.0"
"php": "^7.0",
"phpunit/php-file-iterator": "^1.4.2",
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-token-stream": "^2.0.1",
"sebastian/code-unit-reverse-lookup": "^1.0.1",
"sebastian/environment": "^3.0",
"sebastian/version": "^2.0.1",
"theseer/tokenizer": "^1.1"
},
"require-dev": {
"ext-xdebug": "^2.1.4",
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^6.0"
},
"suggest": {
"ext-xdebug": "^2.5.1"
"ext-xdebug": "^2.5.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0.x-dev"
"dev-master": "5.3.x-dev"
}
},
"autoload": {
@ -716,7 +824,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
@ -727,7 +835,7 @@
"testing",
"xunit"
],
"time": "2017-04-02T07:44:40+00:00"
"time": "2017-12-06T09:29:45+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -868,29 +976,29 @@
},
{
"name": "phpunit/php-token-stream",
"version": "1.4.12",
"version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
"reference": "791198a2c6254db10131eecfe8c06670700904db"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
"reference": "791198a2c6254db10131eecfe8c06670700904db",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3.3"
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
"phpunit/phpunit": "^6.2.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-master": "2.0-dev"
}
},
"autoload": {
@ -913,20 +1021,20 @@
"keywords": [
"tokenizer"
],
"time": "2017-12-04T08:55:13+00:00"
"time": "2017-11-27T05:48:46+00:00"
},
{
"name": "phpunit/phpunit",
"version": "5.7.27",
"version": "6.5.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
"reference": "6bd77b57707c236833d2b57b968e403df060c9d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
"reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6bd77b57707c236833d2b57b968e403df060c9d9",
"reference": "6bd77b57707c236833d2b57b968e403df060c9d9",
"shasum": ""
},
"require": {
@ -935,33 +1043,35 @@
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"myclabs/deep-copy": "~1.3",
"php": "^5.6 || ^7.0",
"phpspec/prophecy": "^1.6.2",
"phpunit/php-code-coverage": "^4.0.4",
"phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "^3.2",
"sebastian/comparator": "^1.2.4",
"sebastian/diff": "^1.4.3",
"sebastian/environment": "^1.3.4 || ^2.0",
"sebastian/exporter": "~2.0",
"sebastian/global-state": "^1.1",
"sebastian/object-enumerator": "~2.0",
"sebastian/resource-operations": "~1.0",
"sebastian/version": "^1.0.6|^2.0.1",
"symfony/yaml": "~2.1|~3.0|~4.0"
"myclabs/deep-copy": "^1.6.1",
"phar-io/manifest": "^1.0.1",
"phar-io/version": "^1.0",
"php": "^7.0",
"phpspec/prophecy": "^1.7",
"phpunit/php-code-coverage": "^5.3",
"phpunit/php-file-iterator": "^1.4.3",
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-timer": "^1.0.9",
"phpunit/phpunit-mock-objects": "^5.0.5",
"sebastian/comparator": "^2.1",
"sebastian/diff": "^2.0",
"sebastian/environment": "^3.1",
"sebastian/exporter": "^3.1",
"sebastian/global-state": "^2.0",
"sebastian/object-enumerator": "^3.0.3",
"sebastian/resource-operations": "^1.0",
"sebastian/version": "^2.0.1"
},
"conflict": {
"phpdocumentor/reflection-docblock": "3.0.2"
"phpdocumentor/reflection-docblock": "3.0.2",
"phpunit/dbunit": "<3.0"
},
"require-dev": {
"ext-pdo": "*"
},
"suggest": {
"ext-xdebug": "*",
"phpunit/php-invoker": "~1.1"
"phpunit/php-invoker": "^1.1"
},
"bin": [
"phpunit"
@ -969,7 +1079,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.7.x-dev"
"dev-master": "6.5.x-dev"
}
},
"autoload": {
@ -995,33 +1105,33 @@
"testing",
"xunit"
],
"time": "2018-02-01T05:50:59+00:00"
"time": "2018-02-26T07:01:09+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "3.4.4",
"version": "5.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
"reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
"reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
"reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.6 || ^7.0",
"phpunit/php-text-template": "^1.2",
"sebastian/exporter": "^1.2 || ^2.0"
"doctrine/instantiator": "^1.0.5",
"php": "^7.0",
"phpunit/php-text-template": "^1.2.1",
"sebastian/exporter": "^3.1"
},
"conflict": {
"phpunit/phpunit": "<5.4.0"
"phpunit/phpunit": "<6.0"
},
"require-dev": {
"phpunit/phpunit": "^5.4"
"phpunit/phpunit": "^6.5"
},
"suggest": {
"ext-soap": "*"
@ -1029,7 +1139,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2.x-dev"
"dev-master": "5.0.x-dev"
}
},
"autoload": {
@ -1044,7 +1154,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
@ -1054,7 +1164,7 @@
"mock",
"xunit"
],
"time": "2017-06-30T09:13:00+00:00"
"time": "2018-01-06T05:45:45+00:00"
},
{
"name": "pimple/pimple",
@ -1299,30 +1409,30 @@
},
{
"name": "sebastian/comparator",
"version": "1.2.4",
"version": "2.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
"reference": "34369daee48eafb2651bea869b4b15d75ccc35f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9",
"reference": "34369daee48eafb2651bea869b4b15d75ccc35f9",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2 || ~2.0"
"php": "^7.0",
"sebastian/diff": "^2.0 || ^3.0",
"sebastian/exporter": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
"phpunit/phpunit": "^6.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
"dev-master": "2.1.x-dev"
}
},
"autoload": {
@ -1353,38 +1463,38 @@
}
],
"description": "Provides the functionality to compare PHP values for equality",
"homepage": "http://www.github.com/sebastianbergmann/comparator",
"homepage": "https://github.com/sebastianbergmann/comparator",
"keywords": [
"comparator",
"compare",
"equality"
],
"time": "2017-01-29T09:50:25+00:00"
"time": "2018-02-01T13:46:46+00:00"
},
{
"name": "sebastian/diff",
"version": "1.4.3",
"version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
"reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
"reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
"phpunit/phpunit": "^6.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-master": "2.0-dev"
}
},
"autoload": {
@ -1411,32 +1521,32 @@
"keywords": [
"diff"
],
"time": "2017-05-22T07:24:03+00:00"
"time": "2017-08-03T08:09:46+00:00"
},
{
"name": "sebastian/environment",
"version": "2.0.0",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
"reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
"reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
"reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0"
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0"
"phpunit/phpunit": "^6.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "3.1.x-dev"
}
},
"autoload": {
@ -1461,34 +1571,34 @@
"environment",
"hhvm"
],
"time": "2016-11-26T07:53:53+00:00"
"time": "2017-07-01T08:51:00+00:00"
},
{
"name": "sebastian/exporter",
"version": "2.0.0",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
"reference": "234199f4528de6d12aaa58b612e98f7d36adb937"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
"reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937",
"reference": "234199f4528de6d12aaa58b612e98f7d36adb937",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/recursion-context": "~2.0"
"php": "^7.0",
"sebastian/recursion-context": "^3.0"
},
"require-dev": {
"ext-mbstring": "*",
"phpunit/phpunit": "~4.4"
"phpunit/phpunit": "^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "3.1.x-dev"
}
},
"autoload": {
@ -1528,27 +1638,27 @@
"export",
"exporter"
],
"time": "2016-11-19T08:54:04+00:00"
"time": "2017-04-03T13:19:02+00:00"
},
{
"name": "sebastian/global-state",
"version": "1.1.1",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
"reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4",
"reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
"phpunit/phpunit": "^6.0"
},
"suggest": {
"ext-uopz": "*"
@ -1556,7 +1666,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "2.0-dev"
}
},
"autoload": {
@ -1579,33 +1689,34 @@
"keywords": [
"global state"
],
"time": "2015-10-12T03:26:01+00:00"
"time": "2017-04-27T15:39:26+00:00"
},
{
"name": "sebastian/object-enumerator",
"version": "2.0.1",
"version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
"reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
"reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5",
"reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5",
"shasum": ""
},
"require": {
"php": ">=5.6",
"sebastian/recursion-context": "~2.0"
"php": "^7.0",
"sebastian/object-reflector": "^1.1.1",
"sebastian/recursion-context": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "~5"
"phpunit/phpunit": "^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "3.0.x-dev"
}
},
"autoload": {
@ -1625,32 +1736,77 @@
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2017-02-18T15:18:39+00:00"
"time": "2017-08-03T12:35:26+00:00"
},
{
"name": "sebastian/recursion-context",
"version": "2.0.0",
"name": "sebastian/object-reflector",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
"url": "https://github.com/sebastianbergmann/object-reflector.git",
"reference": "773f97c67f28de00d397be301821b06708fca0be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
"reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be",
"reference": "773f97c67f28de00d397be301821b06708fca0be",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
"phpunit/phpunit": "^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "1.1-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Allows reflection of object attributes, including inherited and non-public ones",
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
"time": "2017-03-29T09:07:27+00:00"
},
{
"name": "sebastian/recursion-context",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
"reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
"shasum": ""
},
"require": {
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"autoload": {
@ -1678,7 +1834,7 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2016-11-19T07:33:16+00:00"
"time": "2017-03-03T06:23:57+00:00"
},
{
"name": "sebastian/resource-operations",
@ -1837,62 +1993,44 @@
"time": "2017-11-26T19:13:09+00:00"
},
{
"name": "symfony/yaml",
"version": "v3.4.6",
"name": "theseer/tokenizer",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb"
"url": "https://github.com/theseer/tokenizer.git",
"reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/6af42631dcf89e9c616242c900d6c52bd53bd1bb",
"reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b",
"reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
},
"conflict": {
"symfony/console": "<3.4"
},
"require-dev": {
"symfony/console": "~3.4|~4.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
"ext-dom": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": "^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-02-16T09:50:28+00:00"
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"time": "2017-04-07T12:08:54+00:00"
},
{
"name": "webmozart/assert",

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, OnDestroy, AfterContentInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Title } from '@angular/platform-browser';
@ -24,15 +24,17 @@ import { BoardService } from './board.service';
selector: 'tb-board',
templateUrl: './board.component.html'
})
export class BoardDisplay implements OnInit {
export class BoardDisplay implements OnInit, OnDestroy, AfterContentInit {
private strings: any;
private boardNavId: number;
private userFilter: number;
private categoryFilter: number;
private noBoardsMessage: string;
private subs: Array<any>;
private hideFiltered: boolean;
public categoryFilter: number;
public userFilter: number;
public boardNavId: number;
public activeUser: User;
public activeBoard: Board;
public boards: Array<Board>;
@ -45,10 +47,11 @@ export class BoardDisplay implements OnInit {
private active: ActivatedRoute,
private auth: AuthService,
private boardService: BoardService,
private menuService: ContextMenuService,
private notes: NotificationsService,
private stringsService: StringsService,
private dragula: DragulaService) {
public dragula: DragulaService) {
title.setTitle('TaskBoard - Kanban App');
this.boardNavId = null;
@ -56,10 +59,13 @@ export class BoardDisplay implements OnInit {
this.categoryFilter = null;
this.activeBoard = new Board();
this.boards = [];
this.subs = [];
this.loading = true;
this.hideFiltered = false;
stringsService.stringsChanged.subscribe(newStrings => {
let sub = stringsService.stringsChanged.subscribe(newStrings => {
this.strings = newStrings;
// Updating the active user updates some display strings.
@ -67,11 +73,18 @@ export class BoardDisplay implements OnInit {
this.updateActiveUser(this.activeUser);
}
});
this.subs.push(sub);
this.pageName = this.strings.boards;
this.updateBoards();
boardService.activeBoardChanged.subscribe((board: Board) => {
sub = this.boardService.getBoards().subscribe((response: ApiResponse) => {
this.boards = [];
this.updateBoardsList(response.data[1]);
this.loading = false;
});
this.subs.push(sub);
sub = boardService.activeBoardChanged.subscribe((board: Board) => {
if (!board) {
return;
}
@ -81,23 +94,25 @@ export class BoardDisplay implements OnInit {
this.userFilter = null;
this.categoryFilter = null;
});
this.subs.push(sub);
auth.userChanged.subscribe((user: User) => {
sub = auth.userChanged.subscribe((user: User) => {
if (user) {
this.updateActiveUser(user);
}
});
this.subs.push(sub);
active.params.subscribe(params => {
sub = active.params.subscribe(params => {
let id = +params.id;
this.boardNavId = id ? id : null;
this.updateActiveBoard();
});
this.subs.push(sub);
}
ngOnInit(): void {
ngOnInit() {
if (this.boardNavId) {
return;
}
@ -108,6 +123,10 @@ export class BoardDisplay implements OnInit {
}
}
ngOnDestroy() {
this.subs.forEach(sub => sub.unsubscribe());
}
ngAfterContentInit() {
let bag = this.dragula.find('tasks-bag');
@ -142,7 +161,8 @@ export class BoardDisplay implements OnInit {
position++;
});
this.boardService.updateColumn(column).subscribe();
let oneOff = this.boardService.updateColumn(column).subscribe();
oneOff.unsubscribe();
}
});
});
@ -156,14 +176,6 @@ export class BoardDisplay implements OnInit {
this.router.navigate(['/boards/' + this.boardNavId]);
}
updateBoards() {
this.boardService.getBoards().subscribe((response: ApiResponse) => {
this.boards = [];
this.updateBoardsList(response.data[1]);
this.loading = false;
});
}
toggleFiltered() {
this.activeBoard.columns.forEach(column => {
column.tasks.forEach(task => {

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class ActivityTest extends PHPUnit_Framework_TestCase {
class ActivityTest extends PHPUnit\Framework\TestCase {
private $activity;
public static function setupBeforeClass() {

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class AttachmentsTest extends PHPUnit_Framework_TestCase {
class AttachmentsTest extends PHPUnit\Framework\TestCase {
private $attachments;
public static function setupBeforeClass() {

View File

@ -2,7 +2,7 @@
use RedBeanPHP\R;
use Firebase\JWT\JWT;
class AuthTest extends PHPUnit_Framework_TestCase {
class AuthTest extends PHPUnit\Framework\TestCase {
private $auth;
public static function setupBeforeClass() {

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class AutoActionsTest extends PHPUnit_Framework_TestCase {
class AutoActionsTest extends PHPUnit\Framework\TestCase {
private $actions;
public static function setupBeforeClass() {

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class BoardsTest extends PHPUnit_Framework_TestCase {
class BoardsTest extends PHPUnit\Framework\TestCase {
private $boards;
public static function setupBeforeClass() {

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class ColumnsTest extends PHPUnit_Framework_TestCase {
class ColumnsTest extends PHPUnit\Framework\TestCase {
private $columns;
public static function setupBeforeClass() {

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class CommentsTest extends PHPUnit_Framework_TestCase {
class CommentsTest extends PHPUnit\Framework\TestCase {
private $comments;
public static function setupBeforeClass() {

View File

@ -1,7 +1,7 @@
<?php
require_once __DIR__ . '/../Mocks.php';
class InvalidTest extends PHPUnit_Framework_TestCase {
class InvalidTest extends PHPUnit\Framework\TestCase {
public function testCreateInvalid() {
$invalid = new Invalid(new ContainerMock());
$expected = new ApiJson();

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class TasksTest extends PHPUnit_Framework_TestCase {
class TasksTest extends PHPUnit\Framework\TestCase {
private $tasks;
public static function setupBeforeClass() {

View File

@ -2,7 +2,7 @@
require_once __DIR__ . '/../Mocks.php';
use RedBeanPHP\R;
class UsersTest extends PHPUnit_Framework_TestCase {
class UsersTest extends PHPUnit\Framework\TestCase {
private $users;
public static function setupBeforeClass() {

View File

@ -4,8 +4,11 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
import { FormsModule } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { Title } from '@angular/platform-browser';
import { Location } from '@angular/common';
import { Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { DragulaService } from 'ng2-dragula/ng2-dragula';
import { DragulaModule } from 'ng2-dragula/ng2-dragula';
import {
@ -24,6 +27,54 @@ import { BoardService } from '../../../src/app/board/board.service';
import { ColumnDisplay } from '../../../src/app/board/column/column.component';
import { TaskDisplay } from '../../../src/app/board/task/task.component';
class RouterMock {
public url = {
indexOf: str => TestBed.get(Location).path().indexOf(str)
}
navigate(arr) {
TestBed.get(Location).go(arr[0]);
}
}
class DragulaMock {
public opts;
public dropModel = new BehaviorSubject([
{},
{ id: '1' },
{ parentNode: { id: '1' } },
{ parentNode: { id: '1' } }
]);
find () {
return {};
}
destroy () {}
setOptions (name, opts) {
this.opts = opts;
}
}
class BoardServiceMock {
public activeBoardChanged = new BehaviorSubject({ id: 0, name: 'Test', columns: [] });
getBoards () {
return new BehaviorSubject({
data: [{}, [{ id: 1, name: 'Test' }]]
});
}
updateActiveBoard (board) {
this.activeBoardChanged.next(board);
}
updateColumn (col) {
return new BehaviorSubject({});
}
}
describe('BoardDisplay', () => {
let component: BoardDisplay,
fixture: ComponentFixture<BoardDisplay>;
@ -49,10 +100,12 @@ describe('BoardDisplay', () => {
Title,
Constants,
AuthService,
BoardService,
StringsService,
ContextMenuService,
NotificationsService,
{ provide: BoardService, useClass: BoardServiceMock },
{ provide: DragulaService, useClass: DragulaMock },
{ provide: Router, useClass: RouterMock },
{
provide: ActivatedRoute,
useValue: {
@ -71,7 +124,114 @@ describe('BoardDisplay', () => {
})
it('sets the title when constructed', () => {
expect(component.title.getTitle()).toEqual('TaskBoard - Kanban App');
expect(component.title.getTitle()).toEqual('TaskBoard - Test');
});
it('implements ngOnOnit', () => {
component.boardNavId = 0;
component.ngOnInit();
expect(component.boardNavId).toEqual(0);
component.activeUser = <any>{ default_board_id: 2 };
component.ngOnInit();
const location = TestBed.get(Location);
expect(component.boardNavId).toEqual(2);
expect(location.path()).toEqual('/boards/2');
});
it('sets up drag and drop during ngAfterContentInit', () => {
component.activeBoard = <any>{ columns: [
{ id: 1, tasks: [{}] }
] };
component.ngAfterContentInit();
expect((<any>component.dragula).opts.moves).toEqual(jasmine.any(Function));
expect(component.activeBoard.columns[0].tasks[0].position).toEqual(1);
const test = (<any>component.dragula).opts.moves(null, null, {
classList: { contains: () => false }
});
expect(test).toEqual(false);
});
it('has a function to open a board', () => {
component.boardNavId = null;
component.goToBoard();
component.boardNavId = 1;
component.goToBoard();
const location = TestBed.get(Location);
expect(location.path()).toEqual('/boards/1');
});
it('has a function to toggle filtered tasks', () => {
component.activeBoard = <any>{ columns: [
{ tasks: [{ hidefiltered: true }] }
] };
component.toggleFiltered();
expect(component.activeBoard.columns[0].tasks[0].hideFiltered).toEqual(false);
});
it('has a function to filter tasks', () => {
component.userFilter = -1;
component.activeBoard = <any>{
columns: [{
tasks: [{
assignees: []
}]
}]
};
const task = component.activeBoard.columns[0].tasks[0];
component.filterTasks();
expect(task.filtered).toEqual(false);
task.assignees = <any>[{ id: 1 }];
component.filterTasks();
expect(task.filtered).toEqual(true);
component.userFilter = 1;
component.filterTasks();
expect(task.filtered).toEqual(false);
component.categoryFilter = -1;
task.categories = [];
component.filterTasks();
expect(task.filtered).toEqual(false);
task.categories = <any>[{ id: 1 }];
component.filterTasks();
expect(task.filtered).toEqual(true);
component.categoryFilter = 1;
component.filterTasks();
expect(task.filtered).toEqual(false);
});
it('has a function to check for boards', () => {
expect(component.noBoards).toEqual(jasmine.any(Function));
component.loading = false;
component.boards = [];
expect(component.noBoards()).toEqual(true);
component.boards = <any>[{}];
expect(component.noBoards()).toEqual(false);
})
it('updates the boards list from a service', () => {
component.boards = <any>[];
});
});