summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Molenaar <SMillerDev@users.noreply.github.com>2018-03-18 15:01:08 +0100
committerBernhard Posselt <BernhardPosselt@users.noreply.github.com>2018-03-18 15:01:08 +0100
commit17e85dd5079b7ee0b1f18a450b66ec5df3cf5eb3 (patch)
tree4a4ddbea25429a4a9d82b8b28cd935d8838b30f3
parent2de169e43a17bdb6e1d19054e76de3ce7e220052 (diff)
Unit: Fix unittests (#278)
* Unit: Fix unittests Issue #171 * Tests: Move test namespace to the expected nextcloud namespace
-rw-r--r--.travis.yml13
-rw-r--r--appinfo/info.xml2
-rw-r--r--composer.json12
-rw-r--r--composer.lock57
-rw-r--r--lib/Controller/FeedApiController.php1
-rw-r--r--lib/Controller/FolderApiController.php1
-rw-r--r--lib/Controller/ItemApiController.php1
-rw-r--r--lib/Controller/UserApiController.php1
-rw-r--r--lib/Controller/UtilityApiController.php1
-rw-r--r--phpunit.xml20
-rw-r--r--tests/Integration/Db/FeedMapperTest.php5
-rw-r--r--tests/Integration/Db/FolderMapperTest.php6
-rw-r--r--tests/Integration/Db/ItemMapperTest.php4
-rw-r--r--tests/Unit/Config/ConfigTest.php3
-rw-r--r--tests/Unit/Controller/AdminControllerTest.php4
-rw-r--r--tests/Unit/Controller/EntityApiSerializerTest.php4
-rw-r--r--tests/Unit/Controller/ExportControllerTest.php3
-rw-r--r--tests/Unit/Controller/FeedApiControllerTest.php3
-rw-r--r--tests/Unit/Controller/FeedControllerTest.php4
-rw-r--r--tests/Unit/Controller/FolderApiControllerTest.php3
-rw-r--r--tests/Unit/Controller/FolderControllerTest.php138
-rw-r--r--tests/Unit/Controller/ItemApiControllerTest.php3
-rw-r--r--tests/Unit/Controller/ItemControllerTest.php3
-rw-r--r--tests/Unit/Controller/JSONHttpErrorTest.php3
-rw-r--r--tests/Unit/Controller/PageControllerTest.php27
-rw-r--r--tests/Unit/Controller/UserApiControllerTest.php3
-rw-r--r--tests/Unit/Controller/UtilityApiControllerTest.php3
-rw-r--r--tests/Unit/Db/FeedTest.php4
-rw-r--r--tests/Unit/Db/FolderMapperTest.php11
-rw-r--r--tests/Unit/Db/FolderTest.php3
-rw-r--r--tests/Unit/Db/ItemTest.php4
-rw-r--r--tests/Unit/Db/MapperFactoryTest.php4
-rw-r--r--tests/Unit/Db/MapperTestUtility.php1
-rw-r--r--tests/Unit/Fetcher/FeedFetcherTest.php3
-rw-r--r--tests/Unit/Fetcher/FetcherTest.php4
-rw-r--r--tests/Unit/Fetcher/YoutubeFetcherTest.php3
-rw-r--r--tests/Unit/Http/TextDownloadResponseTest.php4
-rw-r--r--tests/Unit/Http/TextResponseTest.php4
-rw-r--r--tests/Unit/Migration/MigrateStatusFlagsTest.php3
-rw-r--r--tests/Unit/Service/FeedServiceTest.php3
-rw-r--r--tests/Unit/Service/FolderServiceTest.php20
-rw-r--r--tests/Unit/Service/ItemServiceTest.php3
-rw-r--r--tests/Unit/Service/ServiceTest.php3
-rw-r--r--tests/Unit/Service/StatusServiceTest.php3
-rw-r--r--tests/Unit/Utility/OPMLExporterTest.php3
-rw-r--r--tests/Unit/Utility/ProxyConfigParserTest.php4
-rw-r--r--tests/Unit/Utility/UpdaterTest.php4
47 files changed, 252 insertions, 167 deletions
diff --git a/.travis.yml b/.travis.yml
index d949ff73a..ec4b55968 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,8 @@ php:
- 5.6
- 7
- 7.1
+ - 7.2
+ - nightly
env:
global:
@@ -16,20 +18,17 @@ env:
matrix:
allow_failures:
- env: DB=pgsql CORE_BRANCH=master
+ - php: nightly
include:
- - php: 5.6
+ - php: 7.1
env: DB=sqlite
- - php: 5.6
+ - php: 7.1
env: DB=mysql
- - php: 5.6
+ - php: 7.1
env: DB=pgsql CORE_BRANCH=master
fast_finish: true
before_install:
- # re-enable once mariadb is added as an option
- # - if [[ "$DB" == 'mysql' ]]; then sudo apt-get -y install mariadb-server; fi
- - nvm install 6
- - npm install -g npm@latest
- make
# install core
- cd ../
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 779fc44be..7df1c7f52 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -35,7 +35,7 @@ Before you update to a new version, [check the changelog](https://github.com/nex
<lib>SimpleXML</lib>
<lib>iconv</lib>
<owncloud max-version="0" min-version="0"/>
- <nextcloud min-version="13" max-version="13"/>
+ <nextcloud min-version="13" max-version="14"/>
</dependencies>
<background-jobs>
diff --git a/composer.json b/composer.json
index 8546a7849..de0e983ad 100644
--- a/composer.json
+++ b/composer.json
@@ -35,6 +35,16 @@
"riimu/kit-pathjoin": "1.1.2"
},
"require-dev": {
- "phpunit/phpunit": "^5.4"
+ "phpunit/phpunit": "^5.7"
+ },
+ "autoload": {
+ "psr-4": {
+ "OCA\\News\\": "lib/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "OCA\\News\\Tests\\": "tests/"
+ }
}
}
diff --git a/composer.lock b/composer.lock
index 7e6c9f95d..ff13fd0fc 100644
--- a/composer.lock
+++ b/composer.lock
@@ -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": "3e09cb824fc2eb931014dc99a3b5b648",
+ "content-hash": "b969e56c53d7689ef20e4d37aa320376",
"packages": [
{
"name": "ezyang/htmlpurifier",
@@ -104,6 +104,7 @@
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/miniflux/picoFeed",
+ "abandoned": true,
"time": "2017-06-12T00:22:06+00:00"
},
{
@@ -414,16 +415,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "4.2.0",
+ "version": "4.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "66465776cfc249844bde6d117abff1d22e06c2da"
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da",
- "reference": "66465776cfc249844bde6d117abff1d22e06c2da",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08",
"shasum": ""
},
"require": {
@@ -461,7 +462,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-27T17:38:31+00:00"
+ "time": "2017-11-30T07:14:17+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@@ -512,16 +513,16 @@
},
{
"name": "phpspec/prophecy",
- "version": "1.7.3",
+ "version": "1.7.5",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf"
+ "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
- "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401",
+ "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"shasum": ""
},
"require": {
@@ -533,7 +534,7 @@
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
- "phpunit/phpunit": "^4.8.35 || ^5.7"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"extra": {
@@ -571,7 +572,7 @@
"spy",
"stub"
],
- "time": "2017-11-24T13:59:53+00:00"
+ "time": "2018-02-19T10:16:54+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -824,16 +825,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "5.7.26",
+ "version": "5.7.27",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "7fbc25c13309de0c4c9bb48b7361f1eca34c7fbd"
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7fbc25c13309de0c4c9bb48b7361f1eca34c7fbd",
- "reference": "7fbc25c13309de0c4c9bb48b7361f1eca34c7fbd",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
"shasum": ""
},
"require": {
@@ -857,7 +858,7 @@
"sebastian/global-state": "^1.1",
"sebastian/object-enumerator": "~2.0",
"sebastian/resource-operations": "~1.0",
- "sebastian/version": "~1.0.3|~2.0",
+ "sebastian/version": "^1.0.6|^2.0.1",
"symfony/yaml": "~2.1|~3.0|~4.0"
},
"conflict": {
@@ -902,7 +903,7 @@
"testing",
"xunit"
],
- "time": "2017-12-17T06:14:38+00:00"
+ "time": "2018-02-01T05:50:59+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -1478,16 +1479,16 @@
},
{
"name": "symfony/yaml",
- "version": "v4.0.2",
+ "version": "v4.0.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "a5ee52d155f06ad23b19eb63c31228ff56ad1116"
+ "reference": "de5f125ea39de846b90b313b2cfb031a0152d223"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/a5ee52d155f06ad23b19eb63c31228ff56ad1116",
- "reference": "a5ee52d155f06ad23b19eb63c31228ff56ad1116",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/de5f125ea39de846b90b313b2cfb031a0152d223",
+ "reference": "de5f125ea39de846b90b313b2cfb031a0152d223",
"shasum": ""
},
"require": {
@@ -1532,20 +1533,20 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2017-12-12T08:41:51+00:00"
+ "time": "2018-02-19T20:08:53+00:00"
},
{
"name": "webmozart/assert",
- "version": "1.2.0",
+ "version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
- "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
- "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a",
"shasum": ""
},
"require": {
@@ -1582,7 +1583,7 @@
"check",
"validate"
],
- "time": "2016-11-23T20:04:58+00:00"
+ "time": "2018-01-29T19:49:41+00:00"
}
],
"aliases": [],
diff --git a/lib/Controller/FeedApiController.php b/lib/Controller/FeedApiController.php
index db158c391..eb57198d8 100644
--- a/lib/Controller/FeedApiController.php
+++ b/lib/Controller/FeedApiController.php
@@ -15,7 +15,6 @@ namespace OCA\News\Controller;
use \OCP\IRequest;
use \OCP\ILogger;
-use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http;
use \OCA\News\Service\FeedService;
diff --git a/lib/Controller/FolderApiController.php b/lib/Controller/FolderApiController.php
index d27be4aa4..88385b171 100644
--- a/lib/Controller/FolderApiController.php
+++ b/lib/Controller/FolderApiController.php
@@ -14,7 +14,6 @@
namespace OCA\News\Controller;
use \OCP\IRequest;
-use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http;
use \OCA\News\Service\FolderService;
diff --git a/lib/Controller/ItemApiController.php b/lib/Controller/ItemApiController.php
index 13ead4285..b99c773a0 100644
--- a/lib/Controller/ItemApiController.php
+++ b/lib/Controller/ItemApiController.php
@@ -14,7 +14,6 @@
namespace OCA\News\Controller;
use \OCP\IRequest;
-use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http;
use \OCA\News\Service\ItemService;
diff --git a/lib/Controller/UserApiController.php b/lib/Controller/UserApiController.php
index 40a1dfa30..66b013f53 100644
--- a/lib/Controller/UserApiController.php
+++ b/lib/Controller/UserApiController.php
@@ -17,7 +17,6 @@ use \OCP\IRequest;
use \OCP\IUserSession;
use \OCP\IURLGenerator;
use \OCP\Files\IRootFolder;
-use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http;
class UserApiController extends ApiController {
diff --git a/lib/Controller/UtilityApiController.php b/lib/Controller/UtilityApiController.php
index a555ea699..0356f25be 100644
--- a/lib/Controller/UtilityApiController.php
+++ b/lib/Controller/UtilityApiController.php
@@ -15,7 +15,6 @@ namespace OCA\News\Controller;
use \OCP\IRequest;
use \OCP\IConfig;
-use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http;
use \OCA\News\Utility\Updater;
diff --git a/phpunit.xml b/phpunit.xml
index 82c96d6c2..768e083b5 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -4,4 +4,24 @@
<directory>./tests/Unit</directory>
</testsuite>
</testsuites>
+ <filter>
+ <whitelist processUncoveredFilesFromWhitelist="true">
+ <directory suffix=".php">./lib/</directory>
+ <exclude>
+ <file>./lib/Config/DependencyException.php</file>
+ <file>./lib/Explore/feeds/RecommendedSiteNotFoundException.php</file>
+ <file>./lib/Explore/feeds/RecommendedSiteNotFoundException.php</file>
+ <file>./lib/Fetcher/FetcherException.php</file>
+ <file>./lib/Service/ServiceConflictException.php</file>
+ <file>./lib/Service/ServiceException.php</file>
+ <file>./lib/Service/ServiceNotFoundException.php</file>
+ <file>./lib/Service/ServiceValidationException.php</file>
+ </exclude>
+ </whitelist>
+ </filter>
+ <logging>
+ <log type="coverage-html" target="./build/report" lowUpperBound="35" highLowerBound="70"/>
+ <log type="coverage-clover" target="./build/coverage.xml"/>
+ <log type="junit" target="./build/junit.xml"/>
+ </logging>
</phpunit>
diff --git a/tests/Integration/Db/FeedMapperTest.php b/tests/Integration/Db/FeedMapperTest.php
index b429149a4..bcf1cb895 100644
--- a/tests/Integration/Db/FeedMapperTest.php
+++ b/