diff --git a/.gitignore b/.gitignore index 0823947..0875093 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ config/config.yml docs/ clover.xml i18n/*/LC_MESSAGES/*.mo +.phpunit.result.cache diff --git a/composer.json b/composer.json index 4da4ffb..9657436 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "ffmpeg/ffmpeg": "^4.1", "heroku/heroku-buildpack-php": "^162.0", "phpstan/phpstan": "~0.9.2", - "phpunit/phpunit": "~6.5.2", + "phpunit/phpunit": "^8.4", "rg3/youtube-dl": "^2019.09", "roave/security-advisories": "dev-master", "smarty-gettext/smarty-gettext": "^1.6", diff --git a/composer.lock b/composer.lock index cbd06a8..46fcb0b 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": "ab03e06d8b44e7b7e69e8f55193ab93e", + "content-hash": "8afb0b828b28214aeaa6dee6aa71df55", "packages": [ { "name": "aura/session", @@ -1178,7 +1178,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -1622,32 +1622,34 @@ }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1667,12 +1669,12 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "ffmpeg/ffmpeg", @@ -1783,25 +1785,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -1824,7 +1829,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "nette/bootstrap", @@ -2405,22 +2410,22 @@ }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -2456,20 +2461,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -2503,39 +2508,37 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2557,30 +2560,30 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2018-08-07T13:53:10+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", + "version": "4.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", + "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.4" }, @@ -2608,41 +2611,40 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" + "time": "2019-09-12T14:27:41+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2655,26 +2657,27 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" }, { "name": "phpspec/prophecy", - "version": "1.8.1", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -2718,7 +2721,7 @@ "spy", "stub" ], - "time": "2019-06-13T12:50:23+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -2830,40 +2833,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "7.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.1.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -2889,29 +2892,32 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2019-11-20T13:55:58+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2926,7 +2932,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2936,32 +2942,32 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -2976,7 +2982,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2985,33 +2991,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2019-06-07T04:22:29+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3034,57 +3040,56 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2019-09-17T06:23:10+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.14", + "version": "8.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + "reference": "67f9e35bffc0dd52d55d565ddbe4230454fd6a4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/67f9e35bffc0dd52d55d565ddbe4230454fd6a4e", + "reference": "67f9e35bffc0dd52d55d565ddbe4230454fd6a4e", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.2.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "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", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" - }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0.0" }, "bin": [ "phpunit" @@ -3092,7 +3097,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "8.4-dev" } }, "autoload": { @@ -3118,67 +3123,7 @@ "testing", "xunit" ], - "time": "2019-02-01T05:22:47+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.11" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-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": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2018-08-09T05:50:03+00:00" + "time": "2019-11-06T09:42:23+00:00" }, { "name": "psr/log", @@ -3501,30 +3446,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3561,32 +3506,33 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3611,34 +3557,40 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2019-02-04T06:01:07+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -3663,20 +3615,20 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", "shasum": "" }, "require": { @@ -3703,6 +3655,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -3711,17 +3667,13 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -3730,27 +3682,30 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2019-09-14T09:02:43+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-uopz": "*" @@ -3758,7 +3713,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3781,7 +3736,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2019-02-01T05:30:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -3930,25 +3885,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -3968,7 +3923,53 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "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", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "time": "2019-07-02T08:10:15+00:00" }, { "name": "sebastian/version", @@ -4533,32 +4534,29 @@ }, { "name": "webmozart/assert", - "version": "1.4.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -4580,7 +4578,7 @@ "check", "validate" ], - "time": "2018-12-25T11:19:39+00:00" + "time": "2019-11-24T13:36:37+00:00" } ], "aliases": [], diff --git a/phpunit.xml b/phpunit.xml index 20daa9a..146eaba 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,7 +7,7 @@ - + tests/ diff --git a/tests/BaseTest.php b/tests/BaseTest.php index 9a98f50..b0d1a48 100644 --- a/tests/BaseTest.php +++ b/tests/BaseTest.php @@ -33,15 +33,16 @@ abstract class BaseTest extends TestCase /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { Config::setFile($this->getConfigFile()); + $this->checkRequirements(); } /** * Destroy properties after test. */ - protected function tearDown() + protected function tearDown(): void { Config::destroyInstance(); } @@ -52,8 +53,6 @@ abstract class BaseTest extends TestCase */ protected function checkRequirements() { - parent::checkRequirements(); - $annotations = $this->getAnnotations(); $requires = []; diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index d5f6c07..703c50c 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -7,6 +7,7 @@ namespace Alltube\Test; use Alltube\Config; +use Exception; /** * Unit tests for the Config class. @@ -23,7 +24,7 @@ class ConfigTest extends BaseTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -65,15 +66,15 @@ class ConfigTest extends BaseTest */ private function assertConfig(Config $config) { - $this->assertInternalType('array', $config->params); - $this->assertInternalType('string', $config->youtubedl); - $this->assertInternalType('string', $config->python); - $this->assertInternalType('string', $config->avconv); - $this->assertInternalType('bool', $config->convert); - $this->assertInternalType('bool', $config->uglyUrls); - $this->assertInternalType('bool', $config->stream); - $this->assertInternalType('bool', $config->remux); - $this->assertInternalType('int', $config->audioBitrate); + $this->assertIsArray($config->params); + $this->assertIsString($config->youtubedl); + $this->assertIsString($config->python); + $this->assertIsString($config->avconv); + $this->assertIsBool($config->convert); + $this->assertIsBool($config->uglyUrls); + $this->assertIsBool($config->stream); + $this->assertIsBool($config->remux); + $this->assertIsInt($config->audioBitrate); } /** @@ -91,10 +92,10 @@ class ConfigTest extends BaseTest * Test the setFile function with a missing config file. * * @return void - * @expectedException Exception */ public function testSetFileWithMissingFile() { + $this->expectException(Exception::class); Config::setFile('foo'); } @@ -132,10 +133,10 @@ class ConfigTest extends BaseTest * Test the setOptions function. * * @return void - * @expectedException Exception */ public function testSetOptionsWithBadYoutubedl() { + $this->expectException(Exception::class); Config::setOptions(['youtubedl' => 'foo']); } @@ -143,10 +144,10 @@ class ConfigTest extends BaseTest * Test the setOptions function. * * @return void - * @expectedException Exception */ public function testSetOptionsWithBadPython() { + $this->expectException(Exception::class); Config::setOptions(['python' => 'foo']); } diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index c703a7d..7d90efe 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -49,7 +49,7 @@ abstract class ControllerTest extends BaseTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/ConvertedPlaylistArchiveStreamTest.php b/tests/ConvertedPlaylistArchiveStreamTest.php index 58b826e..57c7fe6 100644 --- a/tests/ConvertedPlaylistArchiveStreamTest.php +++ b/tests/ConvertedPlaylistArchiveStreamTest.php @@ -18,7 +18,7 @@ class ConvertedPlaylistArchiveStreamTest extends StreamTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/DownloadControllerTest.php b/tests/DownloadControllerTest.php index 7bc4d93..9e93c98 100644 --- a/tests/DownloadControllerTest.php +++ b/tests/DownloadControllerTest.php @@ -18,7 +18,7 @@ class DownloadControllerTest extends ControllerTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 2904d47..20b34bf 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -20,7 +20,7 @@ class FrontControllerTest extends ControllerTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/JsonControllerTest.php b/tests/JsonControllerTest.php index d25f3e6..9256c38 100644 --- a/tests/JsonControllerTest.php +++ b/tests/JsonControllerTest.php @@ -16,7 +16,7 @@ class JsonControllerTest extends ControllerTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 1ceb5d8..7732880 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -24,7 +24,7 @@ class LocaleManagerTest extends BaseTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { $_SESSION[LocaleManager::class]['locale'] = 'foo_BAR'; $this->localeManager = LocaleManager::getInstance(); @@ -35,7 +35,7 @@ class LocaleManagerTest extends BaseTest * * @return void */ - protected function tearDown() + protected function tearDown(): void { $this->localeManager->unsetLocale(); LocaleManager::destroyInstance(); diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 005e87e..d751bd9 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -36,7 +36,7 @@ class LocaleMiddlewareTest extends BaseTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { $this->container = new Container(); $this->container['locale'] = LocaleManager::getInstance(); @@ -48,7 +48,7 @@ class LocaleMiddlewareTest extends BaseTest * * @return void */ - protected function tearDown() + protected function tearDown(): void { $this->container['locale']->unsetLocale(); LocaleManager::destroyInstance(); diff --git a/tests/LocaleTest.php b/tests/LocaleTest.php index aec1f61..2bf2358 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleTest.php @@ -23,7 +23,7 @@ class LocaleTest extends BaseTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { $this->localeObject = new Locale('fr_FR'); } diff --git a/tests/PlaylistArchiveStreamTest.php b/tests/PlaylistArchiveStreamTest.php index 9c301a3..09848e3 100644 --- a/tests/PlaylistArchiveStreamTest.php +++ b/tests/PlaylistArchiveStreamTest.php @@ -18,7 +18,7 @@ class PlaylistArchiveStreamTest extends StreamTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/StreamTest.php b/tests/StreamTest.php index 8071ff4..7ffe235 100644 --- a/tests/StreamTest.php +++ b/tests/StreamTest.php @@ -23,7 +23,7 @@ abstract class StreamTest extends BaseTest * * @return void */ - protected function tearDown() + protected function tearDown(): void { $this->stream->close(); } @@ -50,7 +50,7 @@ abstract class StreamTest extends BaseTest */ public function testTell() { - $this->assertInternalType('int', $this->stream->tell()); + $this->assertIsInt($this->stream->tell()); } /** @@ -82,7 +82,7 @@ abstract class StreamTest extends BaseTest public function testRead() { $result = $this->stream->read(8192); - $this->assertInternalType('string', $result); + $this->assertIsString($result); $this->assertLessThanOrEqual(8192, strlen($result)); } @@ -123,7 +123,7 @@ abstract class StreamTest extends BaseTest */ public function testIsSeekable() { - $this->assertInternalType('boolean', $this->stream->isSeekable()); + $this->assertIsBool($this->stream->isSeekable()); } /** @@ -154,7 +154,7 @@ abstract class StreamTest extends BaseTest */ public function testIsWritable() { - $this->assertInternalType('boolean', $this->stream->isWritable()); + $this->assertIsBool($this->stream->isWritable()); } /** @@ -174,7 +174,7 @@ abstract class StreamTest extends BaseTest */ public function testGetContents() { - $this->assertInternalType('string', $this->stream->getContents()); + $this->assertIsString($this->stream->getContents()); } /** @@ -184,7 +184,7 @@ abstract class StreamTest extends BaseTest */ public function testGetMetadata() { - $this->assertInternalType('array', $this->stream->getMetadata()); + $this->assertIsArray($this->stream->getMetadata()); } /** @@ -194,9 +194,9 @@ abstract class StreamTest extends BaseTest */ public function testGetMetadataWithKey() { - $this->assertInternalType('string', $this->stream->getMetadata('stream_type')); - $this->assertInternalType('string', $this->stream->getMetadata('mode')); - $this->assertInternalType('boolean', $this->stream->getMetadata('seekable')); + $this->assertIsString($this->stream->getMetadata('stream_type')); + $this->assertIsString($this->stream->getMetadata('mode')); + $this->assertIsBool($this->stream->getMetadata('seekable')); $this->assertNull($this->stream->getMetadata('foo')); } @@ -207,7 +207,7 @@ abstract class StreamTest extends BaseTest */ public function testDetach() { - $this->assertInternalType('resource', $this->stream->detach()); + $this->assertIsResource($this->stream->detach()); } /** @@ -217,7 +217,7 @@ abstract class StreamTest extends BaseTest */ public function testToString() { - $this->assertInternalType('string', $this->stream->__toString()); - $this->assertInternalType('string', (string) $this->stream); + $this->assertIsString($this->stream->__toString()); + $this->assertIsString((string) $this->stream); } } diff --git a/tests/UglyRouterTest.php b/tests/UglyRouterTest.php index 6490ec8..f2c08ea 100644 --- a/tests/UglyRouterTest.php +++ b/tests/UglyRouterTest.php @@ -25,7 +25,7 @@ class UglyRouterTest extends BaseTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { $this->router = new UglyRouter(); $this->router->map(['GET'], '/foo', 'print')->setName('foo'); diff --git a/tests/VideoStubsTest.php b/tests/VideoStubsTest.php index 009d5a6..755cdb2 100644 --- a/tests/VideoStubsTest.php +++ b/tests/VideoStubsTest.php @@ -9,6 +9,7 @@ namespace Alltube\Test; use Alltube\Video; use Mockery; use phpmock\mockery\PHPMockery; +use Exception; /** * Unit tests for the Video class. @@ -26,7 +27,7 @@ class VideoStubsTest extends BaseTest /** * Initialize properties used by test. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -41,7 +42,7 @@ class VideoStubsTest extends BaseTest * * @return void */ - protected function tearDown() + protected function tearDown(): void { Mockery::close(); } @@ -50,10 +51,10 @@ class VideoStubsTest extends BaseTest * Test getAudioStream function with a buggy popen. * * @return void - * @expectedException Exception */ public function testGetAudioStreamWithPopenError() { + $this->expectException(Exception::class); $this->video->getAudioStream(); } @@ -61,10 +62,10 @@ class VideoStubsTest extends BaseTest * Test getM3uStream function with a buggy popen. * * @return void - * @expectedException Exception */ public function testGetM3uStreamWithPopenError() { + $this->expectException(Exception::class); $this->video->getM3uStream(); } @@ -72,10 +73,10 @@ class VideoStubsTest extends BaseTest * Test getRtmpStream function with a buggy popen. * * @return void - * @expectedException Exception */ public function testGetRtmpStreamWithPopenError() { + $this->expectException(Exception::class); $this->video->getRtmpStream(); } @@ -83,10 +84,10 @@ class VideoStubsTest extends BaseTest * Test getRemuxStream function with a buggy popen. * * @return void - * @expectedException Exception */ public function testGetRemuxStreamWithPopenError() { + $this->expectException(Exception::class); $video = $this->video->withFormat('bestvideo+bestaudio'); $video->getRemuxStream(); } @@ -95,10 +96,10 @@ class VideoStubsTest extends BaseTest * Test getConvertedStream function with a buggy popen. * * @return void - * @expectedException Exception */ public function testGetConvertedStreamWithPopenError() { + $this->expectException(Exception::class); $this->video->getConvertedStream(32, 'flv'); } } diff --git a/tests/VideoTest.php b/tests/VideoTest.php index b19b538..7967f47 100644 --- a/tests/VideoTest.php +++ b/tests/VideoTest.php @@ -8,6 +8,7 @@ namespace Alltube\Test; use Alltube\Config; use Alltube\Video; +use Exception; /** * Unit tests for the Video class. @@ -48,7 +49,7 @@ class VideoTest extends BaseTest ) { $video = new Video($url, $format); foreach ($video->getUrl() as $videoURL) { - $this->assertContains($domain, $videoURL); + $this->assertStringContainsString($domain, $videoURL); } } @@ -61,7 +62,7 @@ class VideoTest extends BaseTest { $video = new Video('http://vimeo.com/68375962', 'best', 'youtube-dl'); foreach ($video->getUrl() as $videoURL) { - $this->assertContains('vimeocdn.com', $videoURL); + $this->assertStringContainsString('vimeocdn.com', $videoURL); } } @@ -69,10 +70,10 @@ class VideoTest extends BaseTest * Test getUrl function with a protected video and no password. * * @return void - * @expectedException Alltube\Exception\PasswordException */ public function testgetUrlWithMissingPassword() { + $this->expectException(Exception::class); $video = new Video('http://vimeo.com/68375962'); $video->getUrl(); } @@ -81,10 +82,10 @@ class VideoTest extends BaseTest * Test getUrl function with a protected video and a wrong password. * * @return void - * @expectedException Exception */ public function testgetUrlWithWrongPassword() { + $this->expectException(Exception::class); $video = new Video('http://vimeo.com/68375962', 'best', 'foo'); $video->getUrl(); } @@ -95,11 +96,11 @@ class VideoTest extends BaseTest * @param string $url URL * * @return void - * @expectedException Exception * @dataProvider ErrorUrlProvider */ public function testgetUrlError($url) { + $this->expectException(Exception::class); $video = new Video($url); $video->getUrl(); } @@ -132,16 +133,10 @@ class VideoTest extends BaseTest 'bbcodspdns.fcod.llnwd.net', ], [ - 'https://openload.co/f/kUEfGclsU9o', 'best[protocol^=http]', - 'skyrim_no-audio_1080.mp4-kUEfGclsU9o', - 'mp4', - 'openload.co', - ], - [ - 'https://vimeo.com/24195442', 'best[protocol^=http]', + 'https://vimeo.com/24195442', 'http-720p', 'Carving_the_Mountains-24195442', 'mp4', - 'vimeocdn.com', + 'gcs-vimeo.akamaized.net', ] ]; @@ -241,11 +236,11 @@ class VideoTest extends BaseTest * @param string $url URL * * @return void - * @expectedException Exception * @dataProvider ErrorURLProvider */ public function testGetJsonError($url) { + $this->expectException(Exception::class); $video = new Video($url); $video->getJson(); } @@ -275,11 +270,11 @@ class VideoTest extends BaseTest * @param string $url URL * * @return void - * @expectedException Exception * @dataProvider ErrorUrlProvider */ public function testGetFilenameError($url) { + $this->expectException(Exception::class); $video = new Video($url); $video->getFilename(); } @@ -306,11 +301,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @expectedException Exception * @dataProvider urlProvider */ public function testGetAudioStreamAvconvError($url, $format) { + $this->expectException(Exception::class); Config::setOptions(['avconv' => 'foobar']); $video = new Video($url, $format); @@ -324,11 +319,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @expectedException Exception * @dataProvider m3uUrlProvider */ public function testGetAudioStreamM3uError($url, $format) { + $this->expectException(Exception::class); $video = new Video($url, $format); $video->getAudioStream(); } @@ -337,10 +332,10 @@ class VideoTest extends BaseTest * Test getAudioStream function with a DASH URL. * * @return void - * @expectedException Exception */ public function testGetAudioStreamDashError() { + $this->expectException(Exception::class); $video = new Video('https://vimeo.com/251997032', 'bestaudio/best'); $video->getAudioStream(); } @@ -349,10 +344,10 @@ class VideoTest extends BaseTest * Test getAudioStream function with a playlist. * * @return void - * @expectedException Exception */ public function testGetAudioStreamPlaylistError() { + $this->expectException(Exception::class); $video = new Video( 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC', 'best' @@ -369,7 +364,7 @@ class VideoTest extends BaseTest */ private function assertStream($stream) { - $this->assertInternalType('resource', $stream); + $this->assertIsResource($stream); $this->assertFalse(feof($stream)); } @@ -411,10 +406,10 @@ class VideoTest extends BaseTest * * @return void * @dataProvider urlProvider - * @expectedException Exception */ public function testGetRemuxStreamWithWrongVideo($url, $format) { + $this->expectException(Exception::class); $video = new Video($url, $format); $video->getRemuxStream(); } @@ -444,11 +439,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @expectedException Exception * @dataProvider m3uUrlProvider */ public function testGetM3uStreamAvconvError($url, $format) { + $this->expectException(Exception::class); Config::setOptions(['avconv' => 'foobar']); $video = new Video($url, $format); @@ -477,11 +472,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @expectedException Exception * @dataProvider m3uUrlProvider */ public function testGetConvertedStreamM3uError($url, $format) { + $this->expectException(Exception::class); $video = new Video($url, $format); $video->getConvertedStream(32, 'flv'); } diff --git a/tests/YoutubeChunkStreamTest.php b/tests/YoutubeChunkStreamTest.php index a817119..5cce098 100644 --- a/tests/YoutubeChunkStreamTest.php +++ b/tests/YoutubeChunkStreamTest.php @@ -18,7 +18,7 @@ class YoutubeChunkStreamTest extends StreamTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/YoutubeStreamTest.php b/tests/YoutubeStreamTest.php index 3bbd325..2345ea9 100644 --- a/tests/YoutubeStreamTest.php +++ b/tests/YoutubeStreamTest.php @@ -18,7 +18,7 @@ class YoutubeStreamTest extends StreamTest /** * Prepare tests. */ - protected function setUp() + protected function setUp(): void { parent::setUp();