From 49f16bc36b6e995e9ba12bb8166e08fc16be042d Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Wed, 26 Jun 2024 13:58:39 +0200 Subject: [PATCH] ugprade phpunit/phpunit 7.x => 8.x --- .gitignore | 1 + CHANGELOG.md | 3 + composer.json | 8 +- composer.lock | 1118 ++++++++++++++-------- tests/Advanced/QualityComplaintsTest.php | 22 +- tests/Common/ShopsTest.php | 14 +- tests/RequestTestBase.php | 2 +- tests/TrustedShopsTest.php | 496 +++++----- 8 files changed, 1014 insertions(+), 650 deletions(-) diff --git a/.gitignore b/.gitignore index 6497f37..17ebecb 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ # Ignore log & cache files .php-cs-fixer.cache .php_cs.cache +.phpunit.result.cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a5a0e3..8bb7680 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - add Github Actions integration - add Psalm linter +### Security +- ugprade phpunit/phpunit 7.x => 8.x + ## 1.0.0 - 2019-10-08 ### Changed - refactoring of testing strategy diff --git a/composer.json b/composer.json index f3130bf..5f8fc71 100644 --- a/composer.json +++ b/composer.json @@ -8,14 +8,14 @@ "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "7.0.*", - "phpunit/php-code-coverage": "^6.0", + "phpunit/phpunit": "^8.2", + "phpunit/php-code-coverage": "^7.0", "symfony/dotenv": "^4.3", "friendsofphp/php-cs-fixer": "^2.12", "phpmd/phpmd": "^2.6", "php-coveralls/php-coveralls": "^2.1", - "php-mock/php-mock-phpunit": "^2.4", - "vimeo/psalm": "^4.30" + "vimeo/psalm": "^4.30", + "php-mock/php-mock-phpunit": "^2.10" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 6dc5fe1..dbf5b7b 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": "9b030f0acddbd94dd3d950d8b34859d6", + "content-hash": "d2a1b26094f75f38b47139a893591312", "packages": [], "packages-dev": [ { @@ -451,38 +451,81 @@ ], "time": "2019-08-08T18:11:40+00:00" }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -496,7 +539,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -505,7 +548,25 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", @@ -968,37 +1029,39 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1012,7 +1075,17 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-06-12T14:39:25+00:00" }, { "name": "netresearch/jsonmapper", @@ -1261,28 +1334,30 @@ }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "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/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1297,39 +1372,49 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" }, { "name": "Sebastian Heuer", - "role": "Developer", - "email": "sebastian@phpeople.de" + "email": "sebastian@phpeople.de", + "role": "Developer" }, { "name": "Sebastian Bergmann", - "role": "Developer", - "email": "sebastian@phpunit.de" + "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" + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "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/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -1359,7 +1444,11 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" }, { "name": "php-coveralls/php-coveralls", @@ -1497,33 +1586,37 @@ }, { "name": "php-mock/php-mock", - "version": "2.1.2", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock.git", - "reference": "35379d7b382b787215617f124662d9ead72c15e3" + "reference": "fff1a621ebe54100fa3bd852e7be57773a0c0127" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock/zipball/35379d7b382b787215617f124662d9ead72c15e3", - "reference": "35379d7b382b787215617f124662d9ead72c15e3", + "url": "https://api.github.com/repos/php-mock/php-mock/zipball/fff1a621ebe54100fa3bd852e7be57773a0c0127", + "reference": "fff1a621ebe54100fa3bd852e7be57773a0c0127", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1" + "php": "^5.6 || ^7.0 || ^8.0", + "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4" }, "replace": { "malkusch/php-mock": "*" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0" + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0 || ^11.0", + "squizlabs/php_codesniffer": "^3.8" }, "suggest": { "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." }, "type": "library", "autoload": { + "files": [ + "autoload.php" + ], "psr-4": { "phpmock\\": [ "classes/", @@ -1552,31 +1645,42 @@ "mock", "stub", "test", - "test double" + "test double", + "testing" ], - "time": "2019-06-05T20:10:01+00:00" + "support": { + "issues": "https://github.com/php-mock/php-mock/issues", + "source": "https://github.com/php-mock/php-mock/tree/2.5.0" + }, + "funding": [ + { + "url": "https://github.com/michalbundyra", + "type": "github" + } + ], + "time": "2024-02-10T21:07:01+00:00" }, { "name": "php-mock/php-mock-integration", - "version": "2.0.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock-integration.git", - "reference": "5a0d7d7755f823bc2a230cfa45058b40f9013bc4" + "reference": "ec6a00a8129d50ed0f07907c91e3274ca4ade877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/5a0d7d7755f823bc2a230cfa45058b40f9013bc4", - "reference": "5a0d7d7755f823bc2a230cfa45058b40f9013bc4", + "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/ec6a00a8129d50ed0f07907c91e3274ca4ade877", + "reference": "ec6a00a8129d50ed0f07907c91e3274ca4ade877", "shasum": "" }, "require": { "php": ">=5.6", - "php-mock/php-mock": "^2", - "phpunit/php-text-template": "^1" + "php-mock/php-mock": "^2.5", + "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4" }, "require-dev": { - "phpunit/phpunit": "^4|^5" + "phpunit/phpunit": "^5.7.27 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11" }, "type": "library", "autoload": { @@ -1607,26 +1711,39 @@ "test", "test double" ], - "time": "2017-02-17T21:31:34+00:00" + "support": { + "issues": "https://github.com/php-mock/php-mock-integration/issues", + "source": "https://github.com/php-mock/php-mock-integration/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/michalbundyra", + "type": "github" + } + ], + "time": "2024-02-10T21:37:25+00:00" }, { "name": "php-mock/php-mock-phpunit", - "version": "2.4.0", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock-phpunit.git", - "reference": "04f78fe83df4855654373188aca8cccf8bf472ce" + "reference": "e1f7e795990b00937376e345883ea68ca3bda7e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/04f78fe83df4855654373188aca8cccf8bf472ce", - "reference": "04f78fe83df4855654373188aca8cccf8bf472ce", + "url": "https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/e1f7e795990b00937376e345883ea68ca3bda7e0", + "reference": "e1f7e795990b00937376e345883ea68ca3bda7e0", "shasum": "" }, "require": { "php": ">=7", - "php-mock/php-mock-integration": "^2", - "phpunit/phpunit": "^6 || ^7 || ^8" + "php-mock/php-mock-integration": "^2.3", + "phpunit/phpunit": "^6 || ^7 || ^8 || ^9 || ^10.0.17 || ^11" + }, + "require-dev": { + "mockery/mockery": "^1.3.6" }, "type": "library", "autoload": { @@ -1659,34 +1776,42 @@ "phpunit", "stub", "test", - "test double" + "test double", + "testing" + ], + "support": { + "issues": "https://github.com/php-mock/php-mock-phpunit/issues", + "source": "https://github.com/php-mock/php-mock-phpunit/tree/2.10.0" + }, + "funding": [ + { + "url": "https://github.com/michalbundyra", + "type": "github" + } ], - "time": "2019-06-07T12:26:51+00:00" + "time": "2024-02-11T07:24:16+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~6" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -1713,44 +1838,53 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "5.4.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "doctrine/deprecations": "^1.1", + "ext-filter": "*", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "mockery/mockery": "~1.3.5", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1761,38 +1895,53 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], "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-09-12T14:27:41+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + }, + "time": "2024-05-21T05:55:05+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.0.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "reference": "153ae662783729388a584b4361f2545e4d841e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", "shasum": "" }, "require": { - "php": "^7.1", - "phpdocumentor/reflection-common": "^2.0" + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { @@ -1811,7 +1960,11 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + }, + "time": "2024-02-23T11:10:43+00:00" }, { "name": "phpmd/phpmd", @@ -1887,104 +2040,88 @@ "time": "2019-07-30T21:13:32+00:00" }, { - "name": "phpspec/prophecy", - "version": "1.8.1", + "name": "phpstan/phpdoc-parser", + "version": "1.29.1", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" + "PHPStan\\PhpDocParser\\": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2019-06-13T12:50:23+00:00" + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + }, + "time": "2024-05-31T08:52:43+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.0.5", + "version": "7.0.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "4cab20a326d14de7575a8e235c70d879b569a57a" + "reference": "40a4ed114a4aea5afd6df8d0f0c9cd3033097f66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4cab20a326d14de7575a8e235c70d879b569a57a", - "reference": "4cab20a326d14de7575a8e235c70d879b569a57a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/40a4ed114a4aea5afd6df8d0f0c9cd3033097f66", + "reference": "40a4ed114a4aea5afd6df8d0f0c9cd3033097f66", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "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": "^3.0", + "phpunit/php-token-stream": "^3.1.3 || ^4.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1", + "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -2010,29 +2147,42 @@ "testing", "xunit" ], - "time": "2018-05-28T11:49:20+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.17" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:09:37+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "69deeb8664f611f156a924154985fbd4911eb36b" }, "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/69deeb8664f611f156a924154985fbd4911eb36b", + "reference": "69deeb8664f611f156a924154985fbd4911eb36b", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2047,7 +2197,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2057,7 +2207,17 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T13:39:50+00:00" }, { "name": "phpunit/php-text-template", @@ -2098,27 +2258,31 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "2.1.2", + "version": "2.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb" }, "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/a691211e94ff39a34811abd521c31bd5b305b0bb", + "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2147,33 +2311,43 @@ "keywords": [ "timer" ], - "time": "2019-06-07T04:22:29+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T13:42:41+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": { @@ -2196,53 +2370,63 @@ "keywords": [ "tokenizer" ], - "time": "2019-09-17T06:23:10+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "abandoned": true, + "time": "2020-08-04T08:28:15+00:00" }, { "name": "phpunit/phpunit", - "version": "7.0.3", + "version": "8.5.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "536f4d853c12d8189963435088e8ff7c0daeab2e" + "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/536f4d853c12d8189963435088e8ff7c0daeab2e", - "reference": "536f4d853c12d8189963435088e8ff7c0daeab2e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1ecad678646c817a29e55a32c930f3601c3f5a8c", + "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.3.1", "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.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.1", - "phpunit/php-file-iterator": "^1.4.3", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.0", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.2", + "phpunit/php-code-coverage": "^7.0.12", + "phpunit/php-file-iterator": "^2.0.4", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.0", - "phpunit/phpunit-mock-objects": "^6.0", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^3.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.5", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.3", + "sebastian/exporter": "^3.1.5", + "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" }, - "require-dev": { - "ext-pdo": "*" - }, "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage", + "phpunit/php-invoker": "To allow enforcing time limits" }, "bin": [ "phpunit" @@ -2250,7 +2434,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "8.5-dev" } }, "autoload": { @@ -2276,64 +2460,26 @@ "testing", "xunit" ], - "time": "2018-03-26T07:36:48+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "6.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "f9756fd4f43f014cb2dca98deeaaa8ce5500a36e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/f9756fd4f43f014cb2dca98deeaaa8ce5500a36e", - "reference": "f9756fd4f43f014cb2dca98deeaaa8ce5500a36e", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.1", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.38" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + "funding": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2018-05-29T13:54:20+00:00" + "time": "2024-04-05T04:31:23+00:00" }, { "name": "psr/container", @@ -2523,23 +2669,23 @@ }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2564,34 +2710,44 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T13:45:45+00:00" }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", "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": "^8.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2604,6 +2760,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -2615,10 +2775,6 @@ { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", @@ -2628,24 +2784,34 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:31:48+00:00" }, { "name": "sebastian/diff", - "version": "3.0.2", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/98ff311ca519c3aa73ccd3de053bdb377171d7b6", + "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { "phpunit/phpunit": "^7.5 || ^8.0", @@ -2667,13 +2833,13 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", @@ -2684,32 +2850,45 @@ "unidiff", "unified diff" ], - "time": "2019-02-04T06:01:07+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:16:36+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "56932f6049a0482853056ffd617c91ffcc754205" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/56932f6049a0482853056ffd617c91ffcc754205", + "reference": "56932f6049a0482853056ffd617c91ffcc754205", "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": { @@ -2734,29 +2913,39 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T13:49:59+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.2", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1939bc8fd1d39adcfa88c5b35335910869214c56", + "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.2", "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2801,27 +2990,40 @@ "export", "exporter" ], - "time": "2019-09-14T09:02:43+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:21:38+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "91c7c47047a971f02de57ed6f040087ef110c5d9" }, "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/91c7c47047a971f02de57ed6f040087ef110c5d9", + "reference": "91c7c47047a971f02de57ed6f040087ef110c5d9", "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": "*" @@ -2829,7 +3031,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2852,24 +3054,34 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:13:16+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "ac5b293dba925751b808e02923399fb44ff0d541" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/ac5b293dba925751b808e02923399fb44ff0d541", + "reference": "ac5b293dba925751b808e02923399fb44ff0d541", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.0", "sebastian/object-reflector": "^1.1.1", "sebastian/recursion-context": "^3.0" }, @@ -2899,24 +3111,34 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T13:54:02+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "reference": "1d439c229e61f244ff1f211e5c99737f90c67def" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d439c229e61f244ff1f211e5c99737f90c67def", + "reference": "1d439c229e61f244ff1f211e5c99737f90c67def", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" @@ -2944,24 +3166,34 @@ ], "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" + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T13:56:04+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/9bfd3c6f1f08c026f542032dfb42813544f7d64c", + "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" @@ -2982,14 +3214,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" @@ -2997,29 +3229,39 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T14:07:30+00:00" }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee" }, "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/72a7f7674d053d548003b16ff5a106e7e0e06eee", + "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee", "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": { @@ -3039,7 +3281,72 @@ ], "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" + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T13:59:09+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "18f071c3a29892b037d35e6b20ddf3ea39b42874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/18f071c3a29892b037d35e6b20ddf3ea39b42874", + "reference": "18f071c3a29892b037d35e6b20ddf3ea39b42874", + "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", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/1.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-01T14:04:07+00:00" }, { "name": "sebastian/version", @@ -3082,6 +3389,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -3636,37 +3947,41 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.12-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3690,7 +4005,24 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -4221,23 +4553,23 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.3", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -4252,12 +4584,22 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" }, { "name": "vimeo/psalm", @@ -4369,29 +4711,33 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.11.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.10-dev" } }, "autoload": { @@ -4415,7 +4761,11 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" }, { "name": "webmozart/path-util", @@ -4475,7 +4825,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0", + "php": ">=7.4", "ext-curl": "*", "ext-json": "*" }, diff --git a/tests/Advanced/QualityComplaintsTest.php b/tests/Advanced/QualityComplaintsTest.php index c37c1cd..46ca0b5 100644 --- a/tests/Advanced/QualityComplaintsTest.php +++ b/tests/Advanced/QualityComplaintsTest.php @@ -13,7 +13,7 @@ class QualityComplaintsTest extends RequestTestBase /** * {@inheritDoc} */ - public function setup() + public function setup(): void { parent::setup(); @@ -79,26 +79,26 @@ public function testShopsQualityComplaints() /** @var array $response */ $response = $this->ts_restricted->get('shops/'.$TRUSTEDSHOPS_TSID.'/quality/complaints'); - $this->assertInternalType('array', $response); + $this->assertIsArray($response); $this->assertTrue($this->ts_restricted->success()); $this->assertFalse($this->ts_restricted->getLastError()); $this->assertSame( - ['headers', 'httpHeaders', 'body'], - array_keys($this->ts_restricted->getLastResponse()) - ); + ['headers', 'httpHeaders', 'body'], + array_keys($this->ts_restricted->getLastResponse()) + ); $this->assertSame( ['method', 'path', 'url', 'body', 'timeout', 'headers'], - array_keys($this->ts_restricted->getLastRequest()) - ); + array_keys($this->ts_restricted->getLastRequest()) + ); - $this->assertInternalType('string', $response['data']['shop']['url']); + $this->assertIsString($response['data']['shop']['url']); $this->assertEquals('demoshop.trustedshops.com/fr/home', $response['data']['shop']['url']); $this->assertSame( - ['totalComplaintCount', 'activeComplaintCount'], - array_keys((array) $response['data']['shop']['qualityIndicators']['complaintIndicator']) - ); + ['totalComplaintCount', 'activeComplaintCount'], + array_keys((array) $response['data']['shop']['qualityIndicators']['complaintIndicator']) + ); } } diff --git a/tests/Common/ShopsTest.php b/tests/Common/ShopsTest.php index d02e480..3a81e08 100644 --- a/tests/Common/ShopsTest.php +++ b/tests/Common/ShopsTest.php @@ -41,18 +41,18 @@ public function testGetShops() /** @var array $response */ $response = $this->ts_public->get('shops/'.$TRUSTEDSHOPS_TSID); - $this->assertInternalType('array', $response); + $this->assertIsArray($response); $this->assertTrue($this->ts_public->success()); $this->assertFalse($this->ts_public->getLastError()); $this->assertSame( - ['headers', 'httpHeaders', 'body'], - array_keys($this->ts_public->getLastResponse()) - ); + ['headers', 'httpHeaders', 'body'], + array_keys($this->ts_public->getLastResponse()) + ); $this->assertSame( - ['method', 'path', 'url', 'body', 'timeout', 'headers'], - array_keys($this->ts_public->getLastRequest()) - ); + ['method', 'path', 'url', 'body', 'timeout', 'headers'], + array_keys($this->ts_public->getLastRequest()) + ); } } diff --git a/tests/RequestTestBase.php b/tests/RequestTestBase.php index cdcb495..e9c015d 100644 --- a/tests/RequestTestBase.php +++ b/tests/RequestTestBase.php @@ -27,7 +27,7 @@ abstract class RequestTestBase extends TestCase /** * {@inheritDoc} */ - public function setup() + public function setup(): void { $TRUSTEDSHOPS_TSID = getenv('TRUSTEDSHOPS_TSID'); $this->assertNotEmpty($TRUSTEDSHOPS_TSID, 'No environment variables! Copy .env.example -> .env and fill out your TrustedShops account details.'); diff --git a/tests/TrustedShopsTest.php b/tests/TrustedShopsTest.php index 0c9226e..c21e41f 100644 --- a/tests/TrustedShopsTest.php +++ b/tests/TrustedShopsTest.php @@ -48,36 +48,36 @@ public function testSetEndpoint($dc, $scoop, $version, $expected) * @return array * Variation of endpoint */ - public function providerSetEndpoint() + public static function providerSetEndpoint(): iterable { return [ - [null, null, null, 'https://api.trustedshops.com/rest/public/v2'], - [ - null, - 'restricted', - null, - 'https://api.trustedshops.com/rest/restricted/v2', - ], - [ - null, - 'restricted', - 'v3', - 'https://api.trustedshops.com/rest/restricted/v3', - ], - [ - 'api-qa', - 'restricted', - 'v3', - 'https://api-qa.trustedshops.com/rest/restricted/v3', - ], - ['api-qa', null, null, 'https://api-qa.trustedshops.com/rest/public/v2'], - [ - 'api-qa', - 'restricted', - null, - 'https://api-qa.trustedshops.com/rest/restricted/v2', - ], - ]; + [null, null, null, 'https://api.trustedshops.com/rest/public/v2'], + [ + null, + 'restricted', + null, + 'https://api.trustedshops.com/rest/restricted/v2', + ], + [ + null, + 'restricted', + 'v3', + 'https://api.trustedshops.com/rest/restricted/v3', + ], + [ + 'api-qa', + 'restricted', + 'v3', + 'https://api-qa.trustedshops.com/rest/restricted/v3', + ], + ['api-qa', null, null, 'https://api-qa.trustedshops.com/rest/public/v2'], + [ + 'api-qa', + 'restricted', + null, + 'https://api-qa.trustedshops.com/rest/restricted/v2', + ], + ]; } /** @@ -115,13 +115,25 @@ public function testInstantiation() */ public function testSetApiCredentials() { - $this->assertAttributeEmpty('api_credentials_user', $this->ts_restricted); - $this->assertAttributeEmpty('api_credentials_pass', $this->ts_restricted); + $reflection = new \ReflectionClass($this->ts_restricted); + + $property = $reflection->getProperty('api_credentials_user'); + $property->setAccessible(true); + $this->assertEmpty($property->getValue($this->ts_restricted)); + + $property = $reflection->getProperty('api_credentials_pass'); + $property->setAccessible(true); + $this->assertEmpty($property->getValue($this->ts_restricted)); $this->ts_restricted->setApiCredentials('foo', 'bar'); - $this->assertAttributeEquals('foo', 'api_credentials_user', $this->ts_restricted); - $this->assertAttributeEquals('bar', 'api_credentials_pass', $this->ts_restricted); + $property = $reflection->getProperty('api_credentials_user'); + $property->setAccessible(true); + $this->assertEquals('foo', $property->getValue($this->ts_restricted)); + + $property = $reflection->getProperty('api_credentials_pass'); + $property->setAccessible(true); + $this->assertEquals('bar', $property->getValue($this->ts_restricted)); } /** @@ -132,12 +144,12 @@ public function testSetApiCredentials() public function testVerbDelete($method, $args, $timeout) { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['makeRequest']) - ->getMock(); + ->setMethods(['makeRequest']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('makeRequest') - ->with('delete', $method, $args, $timeout); + ->method('makeRequest') + ->with('delete', $method, $args, $timeout); $ts_mock->delete($method, $args, $timeout); } @@ -150,12 +162,12 @@ public function testVerbDelete($method, $args, $timeout) public function testVerbGet($method, $args, $timeout) { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['makeRequest']) - ->getMock(); + ->setMethods(['makeRequest']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('makeRequest') - ->with('get', $method, $args, $timeout); + ->method('makeRequest') + ->with('get', $method, $args, $timeout); $ts_mock->get($method, $args, $timeout); } @@ -168,12 +180,12 @@ public function testVerbGet($method, $args, $timeout) public function testVerbPatch($method, $args, $timeout) { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['makeRequest']) - ->getMock(); + ->setMethods(['makeRequest']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('makeRequest') - ->with('patch', $method, $args, $timeout); + ->method('makeRequest') + ->with('patch', $method, $args, $timeout); $ts_mock->patch($method, $args, $timeout); } @@ -186,12 +198,12 @@ public function testVerbPatch($method, $args, $timeout) public function testVerbPost($method, $args, $timeout) { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['makeRequest']) - ->getMock(); + ->setMethods(['makeRequest']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('makeRequest') - ->with('post', $method, $args, $timeout); + ->method('makeRequest') + ->with('post', $method, $args, $timeout); $ts_mock->post($method, $args, $timeout); } @@ -204,12 +216,12 @@ public function testVerbPost($method, $args, $timeout) public function testVerbPut($method, $args, $timeout) { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['makeRequest']) - ->getMock(); + ->setMethods(['makeRequest']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('makeRequest') - ->with('put', $method, $args, $timeout); + ->method('makeRequest') + ->with('put', $method, $args, $timeout); $ts_mock->put($method, $args, $timeout); } @@ -220,14 +232,14 @@ public function testVerbPut($method, $args, $timeout) * @return array * Variation of verb parameters */ - public function providerVerbMock() + public function providerVerbMock(): iterable { return [ - ['foo', null, 10], - ['foo/bar', null, 20], - ['foo/bar', ['foo' => 'bar'], 20], - ['foo?bar=boo', null, 20], - ]; + ['foo', [], 10], + ['foo/bar', [], 20], + ['foo/bar', ['foo' => 'bar'], 20], + ['foo?bar=boo', [], 20], + ]; } /** @@ -239,27 +251,27 @@ public function testFormatResponseJson() $response['body'] = file_get_contents(__DIR__.'/assets/responses/partials/body.json'); $result = $this->callPrivateMethod($this->ts_public, 'formatResponse', [$response]); - $this->assertInternalType('array', $result); - $this->assertInternalType('array', $this->ts_public->getLastResponse()); + $this->assertIsArray($result); + $this->assertIsArray($this->ts_public->getLastResponse()); $this->assertSame([ - 'response' => [ - 'code' => 200, - 'data' => [ - 'shop' => [ - 'tsId' => 'UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', - 'url' => 'demoshop.trustedshops.com/fr/home', - 'name' => 'Trusted Shops DemoShop FR', - 'languageISO2' => 'fr', - 'targetMarketISO3' => 'FRA', + 'response' => [ + 'code' => 200, + 'data' => [ + 'shop' => [ + 'tsId' => 'UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', + 'url' => 'demoshop.trustedshops.com/fr/home', + 'name' => 'Trusted Shops DemoShop FR', + 'languageISO2' => 'fr', + 'targetMarketISO3' => 'FRA', + ], + ], + 'message' => 'SUCCESS', + 'responseInfo' => [ + 'apiVersion' => '2.4.18', + ], + 'status' => 'SUCCESS', ], - ], - 'message' => 'SUCCESS', - 'responseInfo' => [ - 'apiVersion' => '2.4.18', - ], - 'status' => 'SUCCESS', - ], - ], $result); + ], $result); } /** @@ -292,14 +304,14 @@ public function testSetResponseState() $this->assertArrayHasKey('httpHeaders', $response); $this->assertArrayHasKey('body', $response); $this->assertSame([ - 'Date' => 'Mon, 30 Sep 2019 14:09:23 GMT', - 'Server' => 'Apache', - 'Access-Control-Allow-Origin' => '*', - 'Content-Encoding' => 'gzip', - 'Connection' => 'close', - 'Transfer-Encoding' => 'chunked', - 'Content-Type' => 'application/json', - ], $response['httpHeaders']); + 'Date' => 'Mon, 30 Sep 2019 14:09:23 GMT', + 'Server' => 'Apache', + 'Access-Control-Allow-Origin' => '*', + 'Content-Encoding' => 'gzip', + 'Connection' => 'close', + 'Transfer-Encoding' => 'chunked', + 'Content-Type' => 'application/json', + ], $response['httpHeaders']); $this->assertSame(' {"response":{"code":200,"data":{"shop":{"tsId":"UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA","url":"demoshop.trustedshops.com/fr/home","name":"Trusted Shops DemoShop FR","languageISO2":"fr","targetMarketISO3":"FRA"}},"message":"SUCCESS","responseInfo":{"apiVersion":"2.4.18"},"status":"SUCCESS"}} ', $response['body']); @@ -312,13 +324,13 @@ public function testSetResponseStateError() { $curl_error_mock = $this->getFunctionMock('Antistatique\TrustedShops', 'curl_error'); $curl_error_mock->expects($this->once()) - ->willReturn('Something went wrong.'); + ->willReturn('Something went wrong.'); $this->expectException(Exception::class); $this->expectExceptionMessage('Something went wrong.'); $this->callPrivateMethod($this->ts_public, 'setResponseState', [ - null, false, null, - ]); + [], false, null, + ]); } /** @@ -330,14 +342,14 @@ public function testGetHeadersAsArray() $headers = $this->callPrivateMethod($this->ts_public, 'getHeadersAsArray', [$headers_string]); $this->assertSame([ - 'Date' => 'Mon, 30 Sep 2019 14:09:23 GMT', - 'Server' => 'Apache', - 'Access-Control-Allow-Origin' => '*', - 'Content-Encoding' => 'gzip', - 'Connection' => 'close', - 'Transfer-Encoding' => 'chunked', - 'Content-Type' => 'application/json', - ], $headers); + 'Date' => 'Mon, 30 Sep 2019 14:09:23 GMT', + 'Server' => 'Apache', + 'Access-Control-Allow-Origin' => '*', + 'Content-Encoding' => 'gzip', + 'Connection' => 'close', + 'Transfer-Encoding' => 'chunked', + 'Content-Type' => 'application/json', + ], $headers); } /** @@ -350,45 +362,45 @@ public function testMakeRequestGet() $body_txt = file_get_contents(__DIR__.'/assets/responses/partials/body.txt'); $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['prepareStateForRequest', 'setResponseState', 'formatResponse', 'determineSuccess']) - ->getMock(); + ->setMethods(['prepareStateForRequest', 'setResponseState', 'formatResponse', 'determineSuccess']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('prepareStateForRequest') - ->with('get', 'foo', 'https://api.trustedshops.com/rest/public/v2/foo', 10) - ->willReturn([ - 'headers' => null, - 'httpHeaders' => null, - 'body' => null, - ]); + ->method('prepareStateForRequest') + ->with('get', 'foo', 'https://api.trustedshops.com/rest/public/v2/foo', 10) + ->willReturn([ + 'headers' => null, + 'httpHeaders' => null, + 'body' => null, + ]); $response = [ - 'body' => $body_json, - 'headers' => $headers_json, - 'httpHeaders' => [ - 'Date' => 'Mon, 30 Sep 2019 14:09:23 GMT', - 'Server' => 'Apache', - 'Access-Control-Allow-Origin' => '*', - 'Content-Encoding' => 'gzip', - 'Connection' => 'close', - 'Transfer-Encoding' => 'chunked', - 'Content-Type' => 'application/json', - ], + 'body' => $body_json, + 'headers' => $headers_json, + 'httpHeaders' => [ + 'Date' => 'Mon, 30 Sep 2019 14:09:23 GMT', + 'Server' => 'Apache', + 'Access-Control-Allow-Origin' => '*', + 'Content-Encoding' => 'gzip', + 'Connection' => 'close', + 'Transfer-Encoding' => 'chunked', + 'Content-Type' => 'application/json', + ], ]; $ts_mock->expects($this->once()) - ->method('setResponseState') - ->with($this->isType('array'), $this->isType('string'), $this->anything()) - ->willReturn($response); + ->method('setResponseState') + ->with($this->isType('array'), $this->isType('string'), $this->anything()) + ->willReturn($response); $ts_mock->expects($this->once()) - ->method('formatResponse') - ->with($this->isType('array')) - ->willReturn(json_decode($response['body'], true)); + ->method('formatResponse') + ->with($this->isType('array')) + ->willReturn(json_decode($response['body'], true)); $ts_mock->expects($this->once()) - ->method('determineSuccess') - ->with($this->isType('array'), $this->isType('array'), $this->isType('integer')) - ->willReturn(true); + ->method('determineSuccess') + ->with($this->isType('array'), $this->isType('array'), $this->isType('integer')) + ->willReturn(true); $curl_exec_mock = $this->getFunctionMock('Antistatique\TrustedShops', 'curl_exec'); $curl_exec_mock->expects($this->any())->willReturn($body_txt); @@ -397,28 +409,28 @@ public function testMakeRequestGet() $curl_getinfo_mock->expects($this->any())->willReturn($response['headers']); $result = $this->callPrivateMethod($ts_mock, 'makeRequest', [ - 'get', - 'foo', - ['foo' => 'bar'], - 10, - ]); + 'get', + 'foo', + ['foo' => 'bar'], + 10, + ]); $this->assertSame([ - 'code' => 200, - 'data' => [ - 'shop' => [ - 'tsId' => 'UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', - 'url' => 'demoshop.trustedshops.com/fr/home', - 'name' => 'Trusted Shops DemoShop FR', - 'languageISO2' => 'fr', - 'targetMarketISO3' => 'FRA', - ], - ], - 'message' => 'SUCCESS', - 'responseInfo' => [ - 'apiVersion' => '2.4.18', - ], - 'status' => 'SUCCESS', - ], $result); + 'code' => 200, + 'data' => [ + 'shop' => [ + 'tsId' => 'UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', + 'url' => 'demoshop.trustedshops.com/fr/home', + 'name' => 'Trusted Shops DemoShop FR', + 'languageISO2' => 'fr', + 'targetMarketISO3' => 'FRA', + ], + ], + 'message' => 'SUCCESS', + 'responseInfo' => [ + 'apiVersion' => '2.4.18', + ], + 'status' => 'SUCCESS', + ], $result); } /** @@ -429,9 +441,9 @@ public function testMakeRequestGet() public function testFindHTTPStatus($response, $formatted_response, $expected_code) { $code = $this->callPrivateMethod($this->ts_public, 'findHTTPStatus', [ - $response, - $formatted_response, - ]); + $response, + $formatted_response, + ]); $this->assertEquals($expected_code, $code); } @@ -441,50 +453,50 @@ public function testFindHTTPStatus($response, $formatted_response, $expected_cod * @return array * Variation of HTTP Status response */ - public function providerHTTPStatus() + public static function providerHTTPStatus(): iterable { return [ - [ - ['headers' => ['http_code' => 400]], - null, - 400, - ], - [ - ['headers' => null], - ['code' => 300], - 418, - ], - [ - ['headers' => null, 'body' => ''], - ['code' => 300], - 418, - ], - [ - ['headers' => ['http_code' => 400]], - ['code' => 300], - 400, - ], - [ - ['body' => 'lorem'], - ['code' => 318], - 318, - ], - [ - ['body' => ''], - ['code' => 318], - 418, - ], - [ - null, - null, - 418, - ], - [ - ['headers' => []], - [], - 418, - ], - ]; + [ + ['headers' => ['http_code' => 400]], + null, + 400, + ], + [ + ['headers' => null], + ['code' => 300], + 418, + ], + [ + ['headers' => null, 'body' => ''], + ['code' => 300], + 418, + ], + [ + ['headers' => ['http_code' => 400]], + ['code' => 300], + 400, + ], + [ + ['body' => 'lorem'], + ['code' => 318], + 318, + ], + [ + ['body' => ''], + ['code' => 318], + 418, + ], + [ + [], + null, + 418, + ], + [ + ['headers' => []], + [], + 418, + ], + ]; } /** @@ -495,17 +507,17 @@ public function providerHTTPStatus() public function testDetermineSuccessStatus200($code) { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['findHTTPStatus']) - ->getMock(); + ->setMethods(['findHTTPStatus']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('findHTTPStatus') - ->willReturn($code); + ->method('findHTTPStatus') + ->willReturn($code); $this->assertFalse($ts_mock->success()); $result = $this->callPrivateMethod($ts_mock, 'determineSuccess', [ - null, null, null, - ]); + [], null, 0, + ]); $this->assertTrue($result); $this->assertTrue($ts_mock->success()); } @@ -516,19 +528,19 @@ public function testDetermineSuccessStatus200($code) * @return array * Variation of HTTP Status response */ - public function providerStatus200() + public static function providerStatus200(): iterable { return [ - [ - 200, - ], - [ - 250, - ], - [ - 299, - ], - ]; + [ + 200, + ], + [ + 250, + ], + [ + 299, + ], + ]; } /** @@ -537,18 +549,18 @@ public function providerStatus200() public function testDetermineSuccessErrorMessage() { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['findHTTPStatus']) - ->getMock(); + ->setMethods(['findHTTPStatus']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('findHTTPStatus') - ->willReturn(100); + ->method('findHTTPStatus') + ->willReturn(100); $this->expectException(Exception::class); $this->expectExceptionMessage('ERROR 300: Something went wrong.'); $this->callPrivateMethod($ts_mock, 'determineSuccess', [ - null, ['status' => 'ERROR', 'message' => 'Something went wrong.', 'code' => 300], null, - ]); + [], ['status' => 'ERROR', 'message' => 'Something went wrong.', 'code' => 300], 0, + ]); $this->assertEquals('ERROR 300: Something went wrong.', $ts_mock->getLastError()); } @@ -559,18 +571,18 @@ public function testDetermineSuccessErrorMessage() public function testDetermineSuccessTimeout() { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['findHTTPStatus']) - ->getMock(); + ->setMethods(['findHTTPStatus']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('findHTTPStatus') - ->willReturn(100); + ->method('findHTTPStatus') + ->willReturn(100); $this->expectException(Exception::class); $this->expectExceptionMessage('Request timed out after 20.000000 seconds.'); $this->callPrivateMethod($ts_mock, 'determineSuccess', [ - ['headers' => ['total_time' => 20]], null, 5, - ]); + ['headers' => ['total_time' => 20]], null, 5, + ]); } /** @@ -579,18 +591,18 @@ public function testDetermineSuccessTimeout() public function testDetermineSuccessUnknown() { $ts_mock = $this->getMockBuilder(TrustedShops::class) - ->setMethods(['findHTTPStatus']) - ->getMock(); + ->setMethods(['findHTTPStatus']) + ->getMock(); $ts_mock->expects($this->once()) - ->method('findHTTPStatus') - ->willReturn(100); + ->method('findHTTPStatus') + ->willReturn(100); $this->expectException(Exception::class); $this->expectExceptionMessage('Unknown error, call getLastResponse() to find out what happened.'); $this->callPrivateMethod($ts_mock, 'determineSuccess', [ - ['headers' => ['total_time' => 20]], null, 35, - ]); + ['headers' => ['total_time' => 20]], null, 35, + ]); $this->assertEquals('Unknown error, call getLastResponse() to find out what happened.', $ts_mock->getLastError()); } @@ -601,23 +613,23 @@ public function testDetermineSuccessUnknown() public function testPrepareStateForRequest() { $this->callPrivateMethod($this->ts_public, 'prepareStateForRequest', [ - 'get', 'shops', 'https://api-qa.trustedshops.com/rest/public/v2/shops/UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', 23, - ]); + 'get', 'shops', 'https://api-qa.trustedshops.com/rest/public/v2/shops/UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', 23, + ]); $this->assertFalse($this->ts_public->success()); $this->assertFalse($this->ts_public->getLastError()); $this->assertSame([ - 'headers' => null, - 'httpHeaders' => null, - 'body' => null, - ], $this->ts_public->getLastResponse()); + 'headers' => null, + 'httpHeaders' => null, + 'body' => null, + ], $this->ts_public->getLastResponse()); $this->assertSame([ - 'method' => 'get', - 'path' => 'shops', - 'url' => 'https://api-qa.trustedshops.com/rest/public/v2/shops/UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', - 'body' => '', - 'timeout' => 23, - ], $this->ts_public->getLastRequest()); + 'method' => 'get', + 'path' => 'shops', + 'url' => 'https://api-qa.trustedshops.com/rest/public/v2/shops/UNSMOKGONMYBWZOXNLVRKUQMUHJAYFGCA', + 'body' => '', + 'timeout' => 23, + ], $this->ts_public->getLastRequest()); } /** @@ -629,13 +641,11 @@ public function testAttachRequestPayload() $curl = curl_init(); $curl_setopt_mock = $this->getFunctionMock('Antistatique\TrustedShops', 'curl_setopt'); - $curl_setopt_mock->expects($this->once())->with( - $curl, CURLOPT_POSTFIELDS, '{"name":"john","age":30,"car":null}' - ); + $curl_setopt_mock->expects($this->once())->with($curl, CURLOPT_POSTFIELDS, '{"name":"john","age":30,"car":null}'); $this->callPrivateMethod($this->ts_public, 'attachRequestPayload', [ - &$curl, ['name' => 'john', 'age' => 30, 'car' => null], - ]); + &$curl, ['name' => 'john', 'age' => 30, 'car' => null], + ]); $this->assertSame(['body' => '{"name":"john","age":30,"car":null}'], $this->ts_public->getLastRequest()); } }