summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2020-09-20 22:03:05 +0200
committerBenjamin Brahmer <info@b-brahmer.de>2020-09-25 19:18:04 +0200
commit60ab4941cc7e6ede095e9e4aee3c2bf9a5c3bff6 (patch)
treebaf0b07dd1c545efeb59437af46a99f4d9f69425
parent2c8b4fa019749113658b9ed8cae211b679e4cbc0 (diff)
Move to nextcloud config and update phpunit
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
-rw-r--r--.github/workflows/integration-tests.yml2
-rw-r--r--appinfo/info.xml1
-rw-r--r--composer.json12
-rw-r--r--composer.lock719
-rw-r--r--lib/AppInfo/Application.php80
-rw-r--r--lib/Command/ShowFeed.php10
-rw-r--r--lib/Config/Config.php207
-rw-r--r--lib/Config/FetcherConfig.php31
-rw-r--r--lib/Config/LegacyConfig.php87
-rw-r--r--lib/Controller/AdminController.php94
-rw-r--r--lib/Controller/PageController.php68
-rw-r--r--lib/Cron/Updater.php25
-rwxr-xr-xlib/Fetcher/FeedFetcher.php3
-rw-r--r--lib/Migration/MigrateConfig.php59
-rw-r--r--lib/Scraper/Scraper.php5
-rw-r--r--lib/Service/FeedService.php15
-rw-r--r--lib/Service/FolderService.php16
-rw-r--r--lib/Service/ItemService.php15
-rw-r--r--lib/Service/StatusService.php16
-rw-r--r--lib/Settings/Admin.php44
-rw-r--r--lib/Settings/AdminSettings.php47
-rw-r--r--lib/Utility/PsrLogger.php97
-rw-r--r--lib/Utility/Updater.php12
-rw-r--r--templates/admin.php17
-rw-r--r--tests/Integration/Db/FeedMapperTest.php57
-rw-r--r--tests/Integration/Db/FolderMapperTest.php53
-rw-r--r--tests/Integration/Db/ItemMapperTest.php36
-rw-r--r--tests/Unit/Config/ConfigTest.php261
-rw-r--r--tests/Unit/Controller/AdminControllerTest.php161
-rw-r--r--tests/Unit/Controller/ExportControllerTest.php2
-rw-r--r--tests/Unit/Controller/FeedApiControllerTest.php32
-rw-r--r--tests/Unit/Controller/FeedControllerTest.php10
-rw-r--r--tests/Unit/Controller/FolderApiControllerTest.php24
-rw-r--r--tests/Unit/Controller/FolderControllerTest.php2
-rw-r--r--tests/Unit/Controller/ItemApiControllerTest.php38
-rw-r--r--tests/Unit/Controller/ItemControllerTest.php6
-rw-r--r--tests/Unit/Controller/JSONHttpErrorTest.php2
-rw-r--r--tests/Unit/Controller/PageControllerTest.php241
-rw-r--r--tests/Unit/Controller/UserApiControllerTest.php12
-rw-r--r--tests/Unit/Controller/UtilityApiControllerTest.php2
-rw-r--r--tests/Unit/Db/FolderMapperTest.php2
-rw-r--r--tests/Unit/Db/ItemTest.php30
-rw-r--r--tests/Unit/Db/MapperFactoryTest.php8
-rw-r--r--tests/Unit/Db/MapperTestUtility.php6
-rw-r--r--tests/Unit/Fetcher/FeedFetcherTest.php11
-rw-r--r--tests/Unit/Fetcher/FetcherTest.php2
-rw-r--r--tests/Unit/Fetcher/YoutubeFetcherTest.php2
-rw-r--r--tests/Unit/Http/TextDownloadResponseTest.php4
-rw-r--r--tests/Unit/Http/TextResponseTest.php4
-rw-r--r--tests/Unit/Migration/MigrateStatusFlagsTest.php18
-rw-r--r--tests/Unit/Service/FeedServiceTest.php73
-rw-r--r--tests/Unit/Service/FolderServiceTest.php44
-rw-r--r--tests/Unit/Service/ItemServiceTest.php214
-rw-r--r--tests/Unit/Service/ServiceTest.php2
-rw-r--r--tests/Unit/Service/StatusServiceTest.php197
-rw-r--r--tests/Unit/Utility/OPMLExporterTest.php10
-rw-r--r--tests/Unit/Utility/UpdaterTest.php8
57 files changed, 1578 insertions, 1678 deletions
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index c77145817..14244ab2a 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -28,7 +28,7 @@ jobs:
- 5432:5432 # Maps tcp port 5432 on service container to the host
strategy:
matrix:
- php-versions: ['7.2', '7.3', '7.4']
+ php-versions: ['7.3', '7.4']
nextcloud: ['20']
database: ['sqlite', 'pgsql', 'mysql']
experimental: [false]
diff --git a/appinfo/info.xml b/appinfo/info.xml
index e6d6dab59..a9eb039f5 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -47,6 +47,7 @@ Before you update to a new version, [check the changelog](https://github.com/nex
<repair-steps>
<post-migration>
<step>OCA\News\Migration\MigrateStatusFlags</step>
+ <step>OCA\News\Migration\MigrateConfig</step>
</post-migration>
</repair-steps>
diff --git a/composer.json b/composer.json
index 26654a69c..25d0db908 100644
--- a/composer.json
+++ b/composer.json
@@ -42,10 +42,10 @@
},
"require": {
"php": "^7.2",
- "ezyang/htmlpurifier": "4.12.0",
+ "ezyang/htmlpurifier": "^4.13.0",
"pear/net_url2": "2.2.2",
"riimu/kit-pathjoin": "1.2.0",
- "debril/feed-io": "^4.5",
+ "debril/feed-io": "^v4.7.8",
"arthurhoaro/favicon": "^1.2",
"ext-json": "*",
"ext-simplexml": "*",
@@ -53,11 +53,11 @@
"andreskrey/readability.php": "^2.1"
},
"require-dev": {
- "phpunit/phpunit": "^7.5",
- "squizlabs/php_codesniffer": "^3.4",
+ "phpunit/phpunit": "9.2.6",
+ "squizlabs/php_codesniffer": "^3.5.6",
"guzzlehttp/guzzle": "^6.3",
- "symfony/service-contracts": "1.1.8",
- "phpstan/phpstan": "^0.12.38"
+ "symfony/service-contracts": "2.2.0",
+ "phpstan/phpstan": "^0.12.43"
},
"replace": {
"guzzlehttp/guzzle": "*",
diff --git a/composer.lock b/composer.lock
index 6e091a9ca..e5e4ef9f0 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "bc8a010805b2f925d3c58ddc19b728e8",
+ "content-hash": "d026de8b34993e486d928ef4c509676d",
"packages": [
{
"name": "andreskrey/readability.php",
@@ -178,16 +178,16 @@
},
{
"name": "ezyang/htmlpurifier",
- "version": "v4.12.0",
+ "version": "v4.13.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
- "reference": "a617e55bc62a87eec73bd456d146d134ad716f03"
+ "reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/a617e55bc62a87eec73bd456d146d134ad716f03",
- "reference": "a617e55bc62a87eec73bd456d146d134ad716f03",
+ "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
+ "reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
"shasum": ""
},
"require": {
@@ -203,6 +203,9 @@
},
"files": [
"library/HTMLPurifier.composer.php"
+ ],
+ "exclude-from-classmap": [
+ "/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -221,7 +224,7 @@
"keywords": [
"html"
],
- "time": "2019-10-28T03:44:26+00:00"
+ "time": "2020-06-29T00:56:53+00:00"
},
{
"name": "pear/net_url2",
@@ -663,16 +666,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.2.1",
+ "version": "5.2.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44"
+ "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44",
- "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
+ "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
"shasum": ""
},
"require": {
@@ -711,20 +714,20 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "time": "2020-08-15T11:14:08+00:00"
+ "time": "2020-09-03T19:13:55+00:00"
},
{
"name": "phpdocumentor/type-resolver",
- "version": "1.3.0",
+ "version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "e878a14a65245fbe78f8080eba03b47c3b705651"
+ "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651",
- "reference": "e878a14a65245fbe78f8080eba03b47c3b705651",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
+ "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"shasum": ""
},
"require": {
@@ -756,7 +759,7 @@
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
- "time": "2020-06-27T10:12:23+00:00"
+ "time": "2020-09-17T18:55:26+00:00"
},
{
"name": "phpspec/prophecy",
@@ -823,16 +826,16 @@
},
{
"name": "phpstan/phpstan",
- "version": "0.12.42",
+ "version": "0.12.43",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "7c43b7c2d5ca6554f6231e82e342a710163ac5f4"
+ "reference": "54221b44766cb4bdfe40d1828d5bba5dd79c38c6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7c43b7c2d5ca6554f6231e82e342a710163ac5f4",
- "reference": "7c43b7c2d5ca6554f6231e82e342a710163ac5f4",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/54221b44766cb4bdfe40d1828d5bba5dd79c38c6",
+ "reference": "54221b44766cb4bdfe40d1828d5bba5dd79c38c6",
"shasum": ""
},
"require": {
@@ -875,44 +878,45 @@
"type": "tidelift"
}
],
- "time": "2020-09-02T13:14:53+00:00"
+ "time": "2020-09-19T21:19:38+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "6.1.4",
+ "version": "8.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d"
+ "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d",
- "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca6647ffddd2add025ab3f21644a441d7c146cdc",
+ "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-xmlwriter": "*",
- "php": "^7.1",
- "phpunit/php-file-iterator": "^2.0",
- "phpunit/php-text-template": "^1.2.1",
- "phpunit/php-token-stream": "^3.0",
- "sebastian/code-unit-reverse-lookup": "^1.0.1",
- "sebastian/environment": "^3.1 || ^4.0",
- "sebastian/version": "^2.0.1",
- "theseer/tokenizer": "^1.1"
+ "php": "^7.3",
+ "phpunit/php-file-iterator": "^3.0",
+ "phpunit/php-text-template": "^2.0",
+ "phpunit/php-token-stream": "^4.0",
+ "sebastian/code-unit-reverse-lookup": "^2.0",
+ "sebastian/environment": "^5.0",
+ "sebastian/version": "^3.0",
+ "theseer/tokenizer": "^1.1.3"
},
"require-dev": {
- "phpunit/phpunit": "^7.0"
+ "phpunit/phpunit": "^9.0"
},
"suggest": {
- "ext-xdebug": "^2.6.0"
+ "ext-pcov": "*",
+ "ext-xdebug": "*"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "6.1-dev"
+ "dev-master": "8.0-dev"
}
},
"autoload": {
@@ -938,32 +942,38 @@
"testing",
"xunit"
],
- "time": "2018-10-31T16:06:48+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-05-23T08:02:54+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "2.0.2",
+ "version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "050bedf145a257b1ff02746c31894800e5122946"
+ "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946",
- "reference": "050bedf145a257b1ff02746c31894800e5122946",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/25fefc5b19835ca653877fe081644a3f8c1d915e",
+ "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e",
"shasum": ""
},
"require": {
- "php": "^7.1"
+ "php": "^7.3 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^7.1"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "3.0-dev"
}
},
"autoload": {
@@ -988,26 +998,99 @@
"filesystem",
"iterator"
],
- "time": "2018-09-13T20:33:42+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-07-11T05:18:21+00:00"
+ },
+ {
+ "name": "phpunit/php-invoker",
+ "version": "3.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "7a85b66acc48cacffdf87dadd3694e7123674298"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7a85b66acc48cacffdf87dadd3694e7123674298",
+ "reference": "7a85b66acc48cacffdf87dadd3694e7123674298",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.3 || ^8.0"
+ },
+ "require-dev": {
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^9.0"
+ },
+ "suggest": {
+ "ext-pcntl": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
+ "keywords": [
+ "process"
+ ],
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-08-06T07:04:15+00:00"
},
{
"name": "phpunit/php-text-template",
- "version": "1.2.1",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/6ff9c8ea4d3212b88fcf74e25e516e2c51c99324",
+ "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^7.3 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
"autoload": {
"classmap": [
"src/"
@@ -1029,32 +1112,38 @@
"keywords": [
"template"
],
- "time": "2015-06-21T13:50:34+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-06-26T11:55:37+00:00"
},
{
"name": "phpunit/php-timer",
- "version": "2.1.2",
+ "version": "5.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "1038454804406b0b5f5f520358e78c1c2f71501e"
+ "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e",
- "reference": "1038454804406b0b5f5f520358e78c1c2f71501e",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/cc49734779cbb302bf51a44297dab8c4bbf941e7",
+ "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7",
"shasum": ""
},
"require": {
- "php": "^7.1"
+ "php": "^7.3 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^7.0"
+ "phpunit/phpunit": "^9.2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.1-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -1078,33 +1167,39 @@
"keywords": [
"timer"
],
- "time": "2019-06-07T04:22:29+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-06-26T11:58:13+00:00"
},
{
"name": "phpunit/php-token-stream",
- "version": "3.1.1",
+ "version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff"
+ "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff",
- "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3",
+ "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
- "php": "^7.1"
+ "php": "^7.3 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^7.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -1127,58 +1222,65 @@
"keywords": [
"tokenizer"
],
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"