From 1d9838ac5849d3fcc3bda5a4a56efd65663c41bf Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 29 Dec 2020 23:43:55 -0600 Subject: [PATCH 01/10] wip --- .circleci/config.yml | 13 + .gitattributes | 4 +- .travis.yml | 28 - composer.json | 42 +- composer.lock | 2124 ++++++++++++++------ phpcs.xml | 16 - phpcs.xml.dist | 27 + phpunit.xml | 11 - phpunit.xml.dist | 30 + tests/TestCase.php | 39 + tests/Unit/UserApplicationPasswordTest.php | 0 tests/Unit/UserPasswordTest.php | 63 + tests/bootstrap.php | 3 + tests/wp-password-bcrypt-test.php | 92 - wp-password-bcrypt.php | 139 +- 15 files changed, 1842 insertions(+), 789 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml delete mode 100644 phpcs.xml create mode 100644 phpcs.xml.dist delete mode 100644 phpunit.xml create mode 100644 phpunit.xml.dist create mode 100644 tests/TestCase.php create mode 100644 tests/Unit/UserApplicationPasswordTest.php create mode 100644 tests/Unit/UserPasswordTest.php create mode 100644 tests/bootstrap.php delete mode 100644 tests/wp-password-bcrypt-test.php diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..6b381c5 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,13 @@ +version: 2.1 + +orbs: + php: circleci/php@1 + +workflows: + build: + jobs: + - php/test: + name: php-<< matrix.version >> + matrix: + parameters: + version: ["7.4", "5.6"] diff --git a/.gitattributes b/.gitattributes index 500612b..e1e9b29 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,6 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.travis.yml export-ignore +.circleci export-ignore CONTRIBUTING.md export-ignore -phpcs.xml export-ignore -phpunit.xml export-ignore tests export-ignore \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1569979..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -sudo: false -language: php -php: - - 7.0 - - 5.6 - - 5.5 - - nightly - -matrix: - fast_finish: true - allow_failures: - - php: nightly - -cache: - apt: true - directories: - - $HOME/.composer/cache - - vendor - -before_install: - - composer self-update - - git config --global github.accesstoken $GITHUB_OAUTH_TOKEN - -install: - - composer install -o --prefer-dist --no-interaction - -script: - - composer test diff --git a/composer.json b/composer.json index 06d2a95..c5d3732 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,13 @@ "homepage": "https://github.com/swalkinshaw" }, { - "name": "qwp6t", + "name": "QWp6t", "homepage": "https://github.com/qwp6t" }, + { + "name": "Brandon Nifong", + "homepage": "https://github.com/log1x" + }, { "name": "Jan Pingel", "email": "jpingel@bitpiston.com", @@ -20,41 +24,43 @@ } ], "keywords": [ - "wordpress wp bcrypt password" + "wordpress" ], "support": { "issues": "https://github.com/roots/wp-password-bcrypt/issues", "forum": "https://discourse.roots.io/" }, + "autoload": { + "files": ["wp-password-bcrypt.php"] + }, + "autoload-dev": { + "psr-4": { + "Roots\\PasswordBcrypt\\Tests\\": "tests/" + } + }, "require": { - "php": ">=5.5.0", - "composer/installers": "~1.0" + "php": ">=5.6.0" }, "require-dev": { - "brain/monkey": "^1.3.1", - "mockery/mockery": "^0.9.4", - "squizlabs/php_codesniffer": "^2.5.1", - "phpunit/phpunit": "^4.8.23|^5.2.9" - }, - "autoload": { - "files": ["wp-password-bcrypt.php"] + "squizlabs/php_codesniffer": "^3.5", + "brain/monkey": "^2.5", + "phpunit/phpunit": "<= 9.3", + "mockery/mockery": "^1.3 | ^1.4", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "phpcompatibility/php-compatibility": "^9.3" }, "archive" : { "exclude": [ ".editorconfig", ".gitattributes", ".gitignore", - ".travis.yml", + ".circleci", "CONTRIBUTING.md", - "phpcs.xml", - "phpunit.xml", "tests" ] }, "scripts": { - "test": [ - "vendor/bin/phpcs", - "vendor/bin/phpunit --colors=always" - ] + "test": "phpunit", + "lint": "phpcs" } } diff --git a/composer.lock b/composer.lock index e24d445..70cc72d 100644 --- a/composer.lock +++ b/composer.lock @@ -1,128 +1,31 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "f8001fb681871f02e6f58cec3dd0b39b", - "content-hash": "f794164b0ea4ffbba11dbf552894c427", - "packages": [ - { - "name": "composer/installers", - "version": "v1.0.23", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "6213d900e92647831f7a406d5c530ea1f3d4360e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/6213d900e92647831f7a406d5c530ea1f3d4360e", - "reference": "6213d900e92647831f7a406d5c530ea1f3d4360e", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" - }, - "type": "composer-plugin", - "extra": { - "class": "Composer\\Installers\\Plugin", - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Composer\\Installers\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "http://composer.github.com/installers/", - "keywords": [ - "Craft", - "Dolibarr", - "Hurad", - "MODX Evo", - "OXID", - "SMF", - "Thelia", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "bitrix", - "cakephp", - "chef", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "elgg", - "fuelphp", - "grav", - "installer", - "joomla", - "kohana", - "laravel", - "lithium", - "magento", - "mako", - "mediawiki", - "modulework", - "moodle", - "phpbb", - "piwik", - "ppi", - "puppet", - "roundcube", - "shopware", - "silverstripe", - "symfony", - "typo3", - "wordpress", - "zend", - "zikula" - ], - "time": "2016-01-27 12:54:22" - } - ], + "content-hash": "26a06f55b7736b4708603247183ee52c", + "packages": [], "packages-dev": [ { "name": "antecedent/patchwork", - "version": "1.3.5", + "version": "2.1.12", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "908a233f8a374f02b02ff5e3d6ba687ca506d57d" + "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/908a233f8a374f02b02ff5e3d6ba687ca506d57d", - "reference": "908a233f8a374f02b02ff5e3d6ba687ca506d57d", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/b98e046dd4c0acc34a0846604f06f6111654d9ea", + "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": ">=4" }, "type": "library", "notification-url": "https://packagist.org/downloads/", @@ -135,8 +38,8 @@ "email": "ignas.rudaitis@gmail.com" } ], - "description": "A pure PHP library that lets you redefine user-defined functions at runtime.", - "homepage": "http://antecedent.github.io/patchwork/", + "description": "Method redefinition (monkey-patching) functionality for PHP.", + "homepage": "http://patchwork2.org/", "keywords": [ "aop", "aspect", @@ -146,40 +49,46 @@ "runkit", "testing" ], - "time": "2015-10-09 18:20:06" + "time": "2019-12-22T17:52:09+00:00" }, { "name": "brain/monkey", - "version": "1.3.1", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "1a523003c148a1c736010b75c34a4999a7ed64ec" + "reference": "7042140000b4b18034c0c0010d86274a00f25442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/1a523003c148a1c736010b75c34a4999a7ed64ec", - "reference": "1a523003c148a1c736010b75c34a4999a7ed64ec", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/7042140000b4b18034c0c0010d86274a00f25442", + "reference": "7042140000b4b18034c0c0010d86274a00f25442", "shasum": "" }, "require": { - "antecedent/patchwork": "1.3.*", - "mockery/mockery": "*" + "antecedent/patchwork": "^2.0", + "mockery/mockery": ">=0.9 <2", + "php": ">=5.6.0" }, "require-dev": { - "mockery/mockery": "0.9.3", - "phpunit/phpunit": "~4.8" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || ^0.7", + "phpcompatibility/php-compatibility": "^9.3.0", + "phpunit/phpunit": "^5.7.9 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-version/1": "1.x-dev", + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Brain\\": "src/" - } + "Brain\\Monkey\\": "src/" + }, + "files": [ + "inc/api.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -189,7 +98,7 @@ { "name": "Giuseppe Mazzapica", "email": "giuseppe.mazzapica@gmail.com", - "homepage": "http://gm.zoomlab.it", + "homepage": "https://gmazzap.me", "role": "Developer" } ], @@ -206,38 +115,101 @@ "test", "testing" ], - "time": "2016-02-19 10:42:51" + "time": "2020-10-13T17:56:14+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.1", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", + "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2020-12-07T18:04:37+00:00" }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1 || ^8.0" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -251,33 +223,47 @@ { "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", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "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": "2020-11-10T18:47:58+00:00" }, { "name": "hamcrest/hamcrest-php", - "version": "v1.2.2", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^5.3|^7.0|^8.0" }, "replace": { "cordoval/hamcrest-php": "*", @@ -285,54 +271,59 @@ "kodova/hamcrest-php": "*" }, "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "satooshi/php-coveralls": "dev-master" + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, "autoload": { "classmap": [ "hamcrest" - ], - "files": [ - "hamcrest/Hamcrest.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD" + "BSD-3-Clause" ], "description": "This is the PHP port of Hamcrest Matchers", "keywords": [ "test" ], - "time": "2015-05-11 14:41:42" + "time": "2020-07-09T08:09:16+00:00" }, { "name": "mockery/mockery", - "version": "0.9.4", + "version": "1.4.2", "source": { "type": "git", - "url": "https://github.com/padraic/mockery.git", - "reference": "70bba85e4aabc9449626651f48b9018ede04f86b" + "url": "https://github.com/mockery/mockery.git", + "reference": "20cab678faed06fac225193be281ea0fddb43b93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/70bba85e4aabc9449626651f48b9018ede04f86b", - "reference": "70bba85e4aabc9449626651f48b9018ede04f86b", + "url": "https://api.github.com/repos/mockery/mockery/zipball/20cab678faed06fac225193be281ea0fddb43b93", + "reference": "20cab678faed06fac225193be281ea0fddb43b93", "shasum": "" }, "require": { - "hamcrest/hamcrest-php": "~1.1", + "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": ">=5.3.2" + "php": "^7.3 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^8.5 || ^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.9.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -356,8 +347,8 @@ "homepage": "http://davedevelopment.co.uk" } ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", "keywords": [ "BDD", "TDD", @@ -370,154 +361,139 @@ "test double", "testing" ], - "time": "2015-04-02 19:54:00" + "time": "2020-08-11T18:10:13+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "name": "myclabs/deep-copy", + "version": "1.10.2", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1 || ^8.0" }, - "require-dev": { - "phpunit/phpunit": "~4.0" + "replace": { + "myclabs/deep-copy": "self.version" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "funding": [ { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" } ], - "time": "2015-02-03 12:10:50" + "time": "2020-11-13T09:40:50+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.6.0", + "name": "nikic/php-parser", + "version": "v4.10.4", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "ext-tokenizer": "*", + "php": ">=7.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "4.9-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Nikita Popov" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "A PHP parser written in PHP", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "parser", + "php" ], - "time": "2016-02-15 07:46:21" + "time": "2020-12-20T10:01:03+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "name": "phar-io/manifest", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "url": "https://github.com/phar-io/manifest.git", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -530,44 +506,43 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06 15:47:00" + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2020-06-27T14:33:11+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "name": "phar-io/version", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "url": "https://github.com/phar-io/version.git", + "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", + "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -578,200 +553,1065 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2015-06-21 13:08:43" + "description": "Library for handling version information and constraints", + "time": "2020-12-13T23:18:30+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ - "template" + "compatibility", + "phpcs", + "standards" ], - "time": "2015-06-21 13:50:34" + "time": "2019-12-27T09:44:58+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.7", + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2 || ^8.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", "keywords": [ - "timer" + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ], - "time": "2015-06-21 08:01:12" + "time": "2020-06-27T09:03:43+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.8", + "name": "phpdocumentor/reflection-docblock", + "version": "5.2.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "mockery/mockery": "~1.3.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "5.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-09-15 10:49:45" + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2020-09-03T19:13:55+00:00" }, { - "name": "phpunit/phpunit", - "version": "4.8.23", + "name": "phpdocumentor/type-resolver", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483", - "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" }, - "suggest": { - "phpunit/php-invoker": "~1.1" + "require-dev": { + "ext-tokenizer": "*" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { - "classmap": [ + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2020-09-17T18:55:26+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.12.2", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "245710e971a030f42e08f4912863805570f23d39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", + "reference": "245710e971a030f42e08f4912863805570f23d39", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "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": "2020-12-19T10:15:11+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.10.2", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-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": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:44:49+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-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": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-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": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-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": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "05c76e25f90e40af2cf2b1b39e6d49c5e74aa84c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05c76e25f90e40af2cf2b1b39e6d49c5e74aa84c", + "reference": "05c76e25f90e40af2cf2b1b39e6d49c5e74aa84c", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": "^7.3 || ^8.0", + "phpspec/prophecy": "^1.11.1", + "phpunit/php-code-coverage": "^9.0", + "phpunit/php-file-iterator": "^3.0.4", + "phpunit/php-invoker": "^3.1", + "phpunit/php-text-template": "^2.0.2", + "phpunit/php-timer": "^5.0.1", + "sebastian/code-unit": "^1.0.5", + "sebastian/comparator": "^4.0.3", + "sebastian/diff": "^4.0.2", + "sebastian/environment": "^5.1.2", + "sebastian/exporter": "^4.0.2", + "sebastian/global-state": "^5.0", + "sebastian/object-enumerator": "^4.0.2", + "sebastian/resource-operations": "^3.0.2", + "sebastian/type": "^2.2.1", + "sebastian/version": "^3.0.1" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-08-07T04:24:24+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-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 PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-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": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ "src/" ] }, @@ -782,49 +1622,69 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ - "phpunit", - "testing", - "xunit" + "export", + "exporter" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2016-02-11 14:56:33" + "time": "2020-09-28T05:24:23+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "name": "sebastian/global-state", + "version": "5.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-soap": "*" + "ext-uopz": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -839,44 +1699,47 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "mock", - "xunit" + "global state" ], - "time": "2015-10-02 06:51:40" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:55:19+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.0", + "name": "sebastian/lines-of-code", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "nikic/php-parser": "^4.6", + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -889,56 +1752,48 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2015-07-26 15:48:44" + "time": "2020-11-28T06:42:11+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.1", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -951,46 +1806,45 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2015-12-08 07:14:41" + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "sebastian/environment", - "version": "1.3.5", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1008,40 +1862,40 @@ "email": "sebastian@phpunit.de" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2016-02-26 18:40:46" + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "sebastian/exporter", - "version": "1.2.1", + "name": "sebastian/recursion-context", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1054,62 +1908,53 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2015-06-21 07:55:53" + "time": "2020-10-26T13:17:30+00:00" }, { - "name": "sebastian/global-state", - "version": "1.1.1", + "name": "sebastian/resource-operations", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1127,37 +1972,40 @@ "email": "sebastian@phpunit.de" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2015-10-12 03:26:01" + "time": "2020-09-28T06:45:17+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.2", + "name": "sebastian/type", + "version": "2.3.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -1170,38 +2018,45 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, + "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", + "funding": [ { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2020-10-26T13:18:59+00:00" }, { "name": "sebastian/version", - "version": "1.0.6", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, + "require": { + "php": ">=7.3" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1220,67 +2075,47 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "2.5.1", + "version": "3.5.8", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8" + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": ">=5.1.2" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs", - "scripts/phpcbf" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -1292,42 +2127,49 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2016-01-19 23:39:10" + "time": "2020-10-23T02:01:07+00:00" }, { - "name": "symfony/yaml", - "version": "v3.0.2", + "name": "symfony/polyfill-ctype", + "version": "v1.20.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/3cf0709d7fe936e97bee9e954382e449003f1d9a", - "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1336,17 +2178,132 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", - "time": "2016-02-02 13:44:19" + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "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": "2020-10-23T14:02:19+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "75a63c33a8577608444246075ea0af0d052e452a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2020-07-12T23:59:07+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2020-07-08T17:02:28+00:00" } ], "aliases": [], @@ -1355,7 +2312,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.5.0" + "php": ">=5.6.0" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 75f9618..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - Roots Coding Standards - - - wp-password-bcrypt.php - - - - - - - - - - diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..d8c5651 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,27 @@ + + + PSR12 with PHP 5.6+ compatibility + + + + + + + + + + + + wp-password-bcrypt.php + tests + + + + 1 + + + + + tests/* + + \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index d48eb31..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - ./tests/ - - - diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..b926a3c --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,30 @@ + + + + + ./ + + + ./vendor + ./tests + + + + + + ./tests/Unit + + + \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..977448f --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,39 @@ +shouldReceive('update') + ->withAnyArgs() + ->andReturnNull(); + $wpdb->users = 'wp_users'; + } + + protected function tearDown(): void + { + Monkey\tearDown(); + parent::tearDown(); + } +} diff --git a/tests/Unit/UserApplicationPasswordTest.php b/tests/Unit/UserApplicationPasswordTest.php new file mode 100644 index 0000000..e69de29 diff --git a/tests/Unit/UserPasswordTest.php b/tests/Unit/UserPasswordTest.php new file mode 100644 index 0000000..522c6c0 --- /dev/null +++ b/tests/Unit/UserPasswordTest.php @@ -0,0 +1,63 @@ +once()->andReturn(true); + + $bcrypt_hash = wp_set_password(self::PASSWORD, $user_id); + $this->assertTrue(password_verify(self::PASSWORD, $bcrypt_hash)); + } + + /** @test */ + public function hashing_password_applies_filter() + { + wp_hash_password(self::PASSWORD); + + expectApplied('wp_hash_password_options')->andReturn(self::HASH_BCRYPT); + } + + /** @test */ + public function bcrypt_passwords_should_be_verified() + { + $bad_hash = 'randomhash'; + + $bcrypt_check = wp_check_password(self::PASSWORD, self::HASH_BCRYPT); + $bad_check = wp_check_password(self::PASSWORD, $bad_hash); + + $this->assertTrue($bcrypt_check); + $this->assertFalse($bad_check); + } + + /** @test */ + public function phpass_passwords_should_be_verified_and_converted_to_bcrypt() + { + global $wp_hasher; + + /** @var int $user_id This is necessary to trigger wp_set_password() */ + $user_id = 1; + + $wp_hasher = Monkey::mock('PasswordHash'); + $wp_hasher + ->shouldReceive('CheckPassword') + ->once() + ->with(self::PASSWORD, self::HASH_PHPASS) + ->andReturn(true); + + expect('wp_cache_delete')->once()->andReturn(true); + + $phpass_check = wp_check_password(self::PASSWORD, self::HASH_PHPASS, $user_id); + $this->assertTrue($phpass_check); + } +} \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..0ecc16b --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,3 @@ +shouldReceive('update') - ->withAnyArgs() - ->andReturnNull(); - $wpdb->users = 'wp_users'; - } - - /** {inheritdoc} */ - protected function tearDown() - { - Monkey::tearDownWP(); - parent::tearDown(); - } - - /** @test */ - public function a_password_is_hashed_using_bcrypt() - { - $userId = 1; - - Functions::expect('wp_cache_delete')->once()->andReturn(true); - - $bcrypt_hash = wp_set_password(self::PASSWORD, $userId); - $this->assertTrue(password_verify(self::PASSWORD, $bcrypt_hash)); - } - - /** @test */ - public function hashing_password_applies_filter() - { - wp_hash_password(self::PASSWORD); - - Filters::expectApplied('wp_hash_password_options')->andReturn(self::HASH_BCRYPT); - } - - /** @test */ - public function bcrypt_passwords_should_be_verified() - { - $bad_hash = 'randomhash'; - - $bcrypt_check = wp_check_password(self::PASSWORD, self::HASH_BCRYPT); - $bad_check = wp_check_password(self::PASSWORD, $bad_hash); - - $this->assertTrue($bcrypt_check); - $this->assertFalse($bad_check); - } - - /** @test */ - public function phpass_passwords_should_be_verified_and_converted_to_bcrypt() - { - global $wp_hasher; - - /** @var int $userId This is necessary to trigger wp_set_password() */ - $userId = 1; - - $wp_hasher = M::mock('PasswordHash'); - $wp_hasher - ->shouldReceive('CheckPassword') - ->once() - ->with(self::PASSWORD, self::HASH_PHPASS) - ->andReturn(true); - - Functions::expect('wp_cache_delete')->once()->andReturn(true); - - $phpass_check = wp_check_password(self::PASSWORD, self::HASH_PHPASS, $userId); - $this->assertTrue($phpass_check); - } -} diff --git a/wp-password-bcrypt.php b/wp-password-bcrypt.php index a6291c6..75b2fd4 100644 --- a/wp-password-bcrypt.php +++ b/wp-password-bcrypt.php @@ -1,76 +1,139 @@ CheckPassword($password, $hash); + if (empty($wp_hasher) && require_once(ABSPATH . WPINC . '/class-phpass.php')) { + $wp_hasher = new PasswordHash(8, true); + } - if ($check && $userId) { - $hash = wp_set_password($password, $userId); - } + if ($wp_hasher->CheckPassword($password, $hash) && ! empty($user_id)) { + $hash = wp_set_password($password, $user_id); } - $check = password_verify($password, $hash); - return apply_filters('check_password', $check, $password, $hash, $userId); + return apply_filters( + 'check_password', + password_verify($password, $hash), + $password, + $hash, + $user_id + ); } /** - * Hash password using bcrypt + * Hash the provided password using the PASSWORD_DEFAULT (bcrypt) + * algorithm. * - * @param string $password Plaintext password - * @return bool|string + * @link https://www.php.net/manual/en/function.password-hash.php + * + * @param string $password The password in plain text. + * @return string */ function wp_hash_password($password) { - $options = apply_filters('wp_hash_password_options', []); - return password_hash($password, PASSWORD_DEFAULT, $options); + return password_hash( + $password, + PASSWORD_DEFAULT, + apply_filters('wp_hash_password_options', []) + ); } /** - * Set password using bcrypt + * Hash and update the user's password. * - * @param string $password Plaintext password - * @param int $userId ID of user to whom password belongs - * @return bool|string + * @param string $password The new user password in plaintext. + * @param int $user_id The user ID. + * @return string */ -function wp_set_password($password, $userId) +function wp_set_password($password, $user_id) { - /** @var \wpdb $wpdb */ global $wpdb; $hash = wp_hash_password($password); + $is_api_request = apply_filters( + 'application_password_is_api_request', + (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) || + (defined('REST_REQUEST') && REST_REQUEST) + ); + + if (! $is_api_request) { + $wpdb->update($wpdb->users, [ + 'user_pass' => $hash, + 'user_activation_key' => '' + ], ['ID' => $user_id]); + + clean_user_cache($user_id); + + return $hash; + } + + if ( + ! class_exists('WP_Application_Passwords') || + empty($passwords = WP_Application_Passwords::get_user_application_passwords($user_id)) + ) { + return; + } + + global $wp_hasher; + + if (empty($wp_hasher) && require_once(ABSPATH . WPINC . '/class-phpass.php')) { + $wp_hasher = new PasswordHash(8, true); + } + + foreach ($passwords as $key => $value) { + if (! $wp_hasher->CheckPassword($password, $value['password'])) { + continue; + } + + $passwords[$key]['password'] = $hash; + } - $wpdb->update($wpdb->users, ['user_pass' => $hash, 'user_activation_key' => ''], ['ID' => $userId]); - wp_cache_delete($userId, 'users'); + update_user_meta( + $user_id, + WP_Application_Passwords::USERMETA_KEY_APPLICATION_PASSWORDS, + $passwords + ); return $hash; } From 0cf5edfe828225fff3de0f8ae8d14495ac4facce Mon Sep 17 00:00:00 2001 From: QWp6t Date: Wed, 30 Dec 2020 19:25:49 -0800 Subject: [PATCH 02/10] fix tests --- tests/TestCase.php | 37 ++++++++++++------- tests/Unit/UserApplicationPasswordTest.php | 3 ++ tests/Unit/UserPasswordTest.php | 34 +++++++++++++---- .../wp/wp-includes/class-phpass.php | 3 ++ tests/bootstrap.php | 5 ++- wp-password-bcrypt.php | 12 +++--- 6 files changed, 64 insertions(+), 30 deletions(-) create mode 100644 tests/__fixtures__/wp/wp-includes/class-phpass.php diff --git a/tests/TestCase.php b/tests/TestCase.php index 977448f..5a11aa0 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,16 +2,14 @@ namespace Roots\PasswordBcrypt\Tests; +use Mockery as m; use Brain\Monkey; -use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; -use PHPUnit\Framework\TestCase as TestCaseFramework; +use Mockery\Adapter\Phpunit\MockeryTestCase; // phpcs:disable PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound -class TestCase extends TestCaseFramework +class TestCase extends MockeryTestCase { - use MockeryPHPUnitIntegration; - const PASSWORD = 'password'; const HASH_BCRYPT = '$2y$10$KIMXDMJq9camkaNHkdrmcOaYJ0AT9lvovEf92yWA34sKdfnn97F9i'; const HASH_PHPASS = '$P$BDMJH/qCLaUc5Lj8Oiwp7XmWzrCcJ21'; @@ -20,15 +18,6 @@ protected function setUp(): void { Monkey\setUp(); parent::setUp(); - - global $wpdb; - - $wpdb = Monkey::mock('wpdb'); - $wpdb - ->shouldReceive('update') - ->withAnyArgs() - ->andReturnNull(); - $wpdb->users = 'wp_users'; } protected function tearDown(): void @@ -36,4 +25,24 @@ protected function tearDown(): void Monkey\tearDown(); parent::tearDown(); } + + protected function wpHasher() + { + global $wp_hasher; + + return $wp_hasher = m::mock('overload:PasswordHash'); + } + + protected function wpdb($properties = ['users' => 'wp_users']) + { + global $wpdb; + + $wpdb = m::mock('overload:wpdb'); + + foreach ($properties as $property => $value) { + $wpdb->{$property} = $value; + } + + return $wpdb; + } } diff --git a/tests/Unit/UserApplicationPasswordTest.php b/tests/Unit/UserApplicationPasswordTest.php index e69de29..5991ab7 100644 --- a/tests/Unit/UserApplicationPasswordTest.php +++ b/tests/Unit/UserApplicationPasswordTest.php @@ -0,0 +1,3 @@ +once()->andReturn(true); + $this + ->wpdb() + ->shouldReceive('update') + ->withAnyArgs() + ->andReturnNull(); + + expect('clean_user_cache')->once()->andReturn(true); $bcrypt_hash = wp_set_password(self::PASSWORD, $user_id); $this->assertTrue(password_verify(self::PASSWORD, $bcrypt_hash)); @@ -34,6 +40,14 @@ public function bcrypt_passwords_should_be_verified() $bad_hash = 'randomhash'; $bcrypt_check = wp_check_password(self::PASSWORD, self::HASH_BCRYPT); + + $this + ->wpHasher() + ->shouldReceive('CheckPassword') + ->once() + ->with(self::PASSWORD, $bad_hash) + ->andReturn(false); + $bad_check = wp_check_password(self::PASSWORD, $bad_hash); $this->assertTrue($bcrypt_check); @@ -43,21 +57,25 @@ public function bcrypt_passwords_should_be_verified() /** @test */ public function phpass_passwords_should_be_verified_and_converted_to_bcrypt() { - global $wp_hasher; - /** @var int $user_id This is necessary to trigger wp_set_password() */ $user_id = 1; - $wp_hasher = Monkey::mock('PasswordHash'); - $wp_hasher + $this + ->wpdb() + ->shouldReceive('update') + ->withAnyArgs() + ->andReturnNull(); + + $this + ->wpHasher() ->shouldReceive('CheckPassword') ->once() ->with(self::PASSWORD, self::HASH_PHPASS) ->andReturn(true); - expect('wp_cache_delete')->once()->andReturn(true); + expect('clean_user_cache')->once()->andReturn(true); $phpass_check = wp_check_password(self::PASSWORD, self::HASH_PHPASS, $user_id); $this->assertTrue($phpass_check); } -} \ No newline at end of file +} diff --git a/tests/__fixtures__/wp/wp-includes/class-phpass.php b/tests/__fixtures__/wp/wp-includes/class-phpass.php new file mode 100644 index 0000000..7229143 --- /dev/null +++ b/tests/__fixtures__/wp/wp-includes/class-phpass.php @@ -0,0 +1,3 @@ + Date: Thu, 31 Dec 2020 01:52:33 -0600 Subject: [PATCH 03/10] clean up --- .editorconfig | 13 +++--- tests/MocksWpHasher.php | 15 +++++++ tests/MocksWpdb.php | 21 ++++++++++ tests/TestCase.php | 28 +------------ tests/TestCaseLegacy.php | 24 +++++++++++ tests/Unit/UserApplicationPasswordTest.php | 3 -- tests/Unit/UserPasswordTest.php | 46 ++++++++++++---------- tests/bootstrap.php | 8 +++- wp-password-bcrypt.php | 4 +- 9 files changed, 104 insertions(+), 58 deletions(-) create mode 100644 tests/MocksWpHasher.php create mode 100644 tests/MocksWpdb.php create mode 100644 tests/TestCaseLegacy.php delete mode 100644 tests/Unit/UserApplicationPasswordTest.php diff --git a/.editorconfig b/.editorconfig index 09a9fd8..1f77ff5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,14 +1,15 @@ -# editorconfig.org - root = true [*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true indent_style = space indent_size = 2 -end_of_line = lf -charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false [*.php] -indent_size = 4 +indent_size = 4 \ No newline at end of file diff --git a/tests/MocksWpHasher.php b/tests/MocksWpHasher.php new file mode 100644 index 0000000..454b0dc --- /dev/null +++ b/tests/MocksWpHasher.php @@ -0,0 +1,15 @@ + 'wp_users']) + { + global $wpdb; + + $wpdb = Mockery::mock('overload:wpdb'); + + foreach ($properties as $property => $value) { + $wpdb->{$property} = $value; + } + + return $wpdb; + } +} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index 5a11aa0..8298f6f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,17 +2,13 @@ namespace Roots\PasswordBcrypt\Tests; -use Mockery as m; use Brain\Monkey; use Mockery\Adapter\Phpunit\MockeryTestCase; -// phpcs:disable PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound - class TestCase extends MockeryTestCase { - const PASSWORD = 'password'; - const HASH_BCRYPT = '$2y$10$KIMXDMJq9camkaNHkdrmcOaYJ0AT9lvovEf92yWA34sKdfnn97F9i'; - const HASH_PHPASS = '$P$BDMJH/qCLaUc5Lj8Oiwp7XmWzrCcJ21'; + use MocksWpdb; + use MocksWpHasher; protected function setUp(): void { @@ -25,24 +21,4 @@ protected function tearDown(): void Monkey\tearDown(); parent::tearDown(); } - - protected function wpHasher() - { - global $wp_hasher; - - return $wp_hasher = m::mock('overload:PasswordHash'); - } - - protected function wpdb($properties = ['users' => 'wp_users']) - { - global $wpdb; - - $wpdb = m::mock('overload:wpdb'); - - foreach ($properties as $property => $value) { - $wpdb->{$property} = $value; - } - - return $wpdb; - } } diff --git a/tests/TestCaseLegacy.php b/tests/TestCaseLegacy.php new file mode 100644 index 0000000..ac598af --- /dev/null +++ b/tests/TestCaseLegacy.php @@ -0,0 +1,24 @@ +wpdb() ->shouldReceive('update') ->withAnyArgs() ->andReturnNull(); - expect('clean_user_cache')->once()->andReturn(true); + expect('clean_user_cache') + ->once() + ->andReturn(true); - $bcrypt_hash = wp_set_password(self::PASSWORD, $user_id); - $this->assertTrue(password_verify(self::PASSWORD, $bcrypt_hash)); + $this->assertTrue( + password_verify(self::PASSWORD, wp_set_password(self::PASSWORD, 1)) + ); } /** @test */ @@ -31,35 +37,32 @@ public function hashing_password_applies_filter() { wp_hash_password(self::PASSWORD); - expectApplied('wp_hash_password_options')->andReturn(self::HASH_BCRYPT); + expectApplied('wp_hash_password_options') + ->andReturn(self::HASH_BCRYPT); } /** @test */ public function bcrypt_passwords_should_be_verified() { - $bad_hash = 'randomhash'; - - $bcrypt_check = wp_check_password(self::PASSWORD, self::HASH_BCRYPT); - $this ->wpHasher() ->shouldReceive('CheckPassword') ->once() - ->with(self::PASSWORD, $bad_hash) + ->with(self::PASSWORD, self::HASH_BAD) ->andReturn(false); - $bad_check = wp_check_password(self::PASSWORD, $bad_hash); + $this->assertTrue( + wp_check_password(self::PASSWORD, self::HASH_BCRYPT) + ); - $this->assertTrue($bcrypt_check); - $this->assertFalse($bad_check); + $this->assertFalse( + wp_check_password(self::PASSWORD, self::HASH_BAD) + ); } /** @test */ public function phpass_passwords_should_be_verified_and_converted_to_bcrypt() { - /** @var int $user_id This is necessary to trigger wp_set_password() */ - $user_id = 1; - $this ->wpdb() ->shouldReceive('update') @@ -73,9 +76,12 @@ public function phpass_passwords_should_be_verified_and_converted_to_bcrypt() ->with(self::PASSWORD, self::HASH_PHPASS) ->andReturn(true); - expect('clean_user_cache')->once()->andReturn(true); + expect('clean_user_cache') + ->once() + ->andReturn(true); - $phpass_check = wp_check_password(self::PASSWORD, self::HASH_PHPASS, $user_id); - $this->assertTrue($phpass_check); + $this->assertTrue( + wp_check_password(self::PASSWORD, self::HASH_PHPASS, 1) + ); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2e7239b..2156f19 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,6 +1,12 @@ update($wpdb->users, [ 'user_pass' => $hash, 'user_activation_key' => '' From f4da621f40aaee942a9602d00e3614a156cb7db4 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 31 Dec 2020 02:05:33 -0600 Subject: [PATCH 04/10] exclude phpcs.xml.dist and phpunit.xml.dist --- .gitattributes | 2 ++ composer.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitattributes b/.gitattributes index e1e9b29..2d6d7b6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,4 +3,6 @@ .gitignore export-ignore .circleci export-ignore CONTRIBUTING.md export-ignore +phpcs.xml.dist export-ignore +phpunit.xml.dist export-ignore tests export-ignore \ No newline at end of file diff --git a/composer.json b/composer.json index c5d3732..08f33da 100644 --- a/composer.json +++ b/composer.json @@ -56,6 +56,8 @@ ".gitignore", ".circleci", "CONTRIBUTING.md", + "phpcs.xml.dist", + "phpunit.xml.dist", "tests" ] }, From f0efb922c4a20c1cca4f0ebaaa68610efa047293 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 31 Dec 2020 13:49:26 -0600 Subject: [PATCH 05/10] Update wp-password-bcrypt.php --- wp-password-bcrypt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-password-bcrypt.php b/wp-password-bcrypt.php index dac70fa..5b0bd01 100644 --- a/wp-password-bcrypt.php +++ b/wp-password-bcrypt.php @@ -45,7 +45,7 @@ function wp_check_password($password, $hash, $user_id = '') $wp_hasher = new PasswordHash(8, true); } - if ($wp_hasher->CheckPassword($password, $hash) && ! empty($user_id)) { + if (! empty($user_id) && $wp_hasher->CheckPassword($password, $hash)) { $hash = wp_set_password($password, $user_id); } From 83ced9aa4f9e7920ff6cdb7e0e557da140c0e4f7 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 31 Dec 2020 16:16:55 -0600 Subject: [PATCH 06/10] fix linting & tests --- tests/MocksWpHasher.php | 2 +- tests/MocksWpdb.php | 2 +- tests/TestCase.php | 47 +++++++++++++++++++++++++++++++++ tests/TestCaseLegacy.php | 47 ++++++++++++++++++++++++++++++++- tests/Unit/UserPasswordTest.php | 21 ++++++--------- tests/bootstrap.php | 10 +++---- 6 files changed, 108 insertions(+), 21 deletions(-) diff --git a/tests/MocksWpHasher.php b/tests/MocksWpHasher.php index 454b0dc..38a021e 100644 --- a/tests/MocksWpHasher.php +++ b/tests/MocksWpHasher.php @@ -12,4 +12,4 @@ protected function wpHasher() return $wp_hasher = Mockery::mock('overload:PasswordHash'); } -} \ No newline at end of file +} diff --git a/tests/MocksWpdb.php b/tests/MocksWpdb.php index 63e8d73..3217850 100644 --- a/tests/MocksWpdb.php +++ b/tests/MocksWpdb.php @@ -18,4 +18,4 @@ protected function wpdb($properties = ['users' => 'wp_users']) return $wpdb; } -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index 8298f6f..e19097d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,17 +5,64 @@ use Brain\Monkey; use Mockery\Adapter\Phpunit\MockeryTestCase; +// phpcs:disable PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound + class TestCase extends MockeryTestCase { use MocksWpdb; use MocksWpHasher; + /** + * The user ID to use while testing the plugin. + * + * @var int + */ + protected static $userId = 1; + + /** + * The password to use while testing the plugin. + * + * @var string + */ + protected static $password = 'password'; + + /** + * The expected password bcrypt hash. + * + * @var string + */ + protected static $bcryptHash = '$2y$10$KIMXDMJq9camkaNHkdrmcOaYJ0AT9lvovEf92yWA34sKdfnn97F9i'; + + /** + * The expected password PHPass hash. + * + * @var string + */ + protected static $phpassHash = '$P$BDMJH/qCLaUc5Lj8Oiwp7XmWzrCcJ21'; + + /** + * The expected invalid hash. + * + * @var string + */ + protected static $invalidHash = 'NOT_A_REAL_HASH'; + + /** + * Setup the test case. + * + * @return void + */ protected function setUp(): void { Monkey\setUp(); parent::setUp(); } + /** + * Tear down the test case. + * + * @return void + */ protected function tearDown(): void { Monkey\tearDown(); diff --git a/tests/TestCaseLegacy.php b/tests/TestCaseLegacy.php index ac598af..1308dce 100644 --- a/tests/TestCaseLegacy.php +++ b/tests/TestCaseLegacy.php @@ -10,15 +10,60 @@ class TestCaseLegacy extends MockeryTestCase use MocksWpdb; use MocksWpHasher; + /** + * The user ID to use while testing the plugin. + * + * @var int + */ + protected static $userId = 1; + + /** + * The password to use while testing the plugin. + * + * @var string + */ + protected static $password = 'password'; + + /** + * The expected password bcrypt hash. + * + * @var string + */ + protected static $bcryptHash = '$2y$10$KIMXDMJq9camkaNHkdrmcOaYJ0AT9lvovEf92yWA34sKdfnn97F9i'; + + /** + * The expected password PHPass hash. + * + * @var string + */ + protected static $phpassHash = '$P$BDMJH/qCLaUc5Lj8Oiwp7XmWzrCcJ21'; + + /** + * The expected invalid hash. + * + * @var string + */ + protected static $invalidHash = 'NOT_A_REAL_HASH'; + + /** + * Setup the test case. + * + * @return void + */ protected function setUp() { Monkey\setUp(); parent::setUp(); } + /** + * Tear down the test case. + * + * @return void + */ protected function tearDown() { Monkey\tearDown(); parent::tearDown(); } -} \ No newline at end of file +} diff --git a/tests/Unit/UserPasswordTest.php b/tests/Unit/UserPasswordTest.php index fc60e9f..a449d18 100644 --- a/tests/Unit/UserPasswordTest.php +++ b/tests/Unit/UserPasswordTest.php @@ -9,11 +9,6 @@ class UserPasswordTest extends TestCase { - const PASSWORD = 'password'; - const HASH_BCRYPT = '$2y$10$KIMXDMJq9camkaNHkdrmcOaYJ0AT9lvovEf92yWA34sKdfnn97F9i'; - const HASH_PHPASS = '$P$BDMJH/qCLaUc5Lj8Oiwp7XmWzrCcJ21'; - const HASH_BAD = 'NOTAREALHASH'; - /** @test */ public function a_password_is_hashed_using_bcrypt() { @@ -28,17 +23,17 @@ public function a_password_is_hashed_using_bcrypt() ->andReturn(true); $this->assertTrue( - password_verify(self::PASSWORD, wp_set_password(self::PASSWORD, 1)) + password_verify(self::$password, wp_set_password(self::$password, self::$userId)) ); } /** @test */ public function hashing_password_applies_filter() { - wp_hash_password(self::PASSWORD); + wp_hash_password(self::$password); expectApplied('wp_hash_password_options') - ->andReturn(self::HASH_BCRYPT); + ->andReturn(self::$bcryptHash); } /** @test */ @@ -48,15 +43,15 @@ public function bcrypt_passwords_should_be_verified() ->wpHasher() ->shouldReceive('CheckPassword') ->once() - ->with(self::PASSWORD, self::HASH_BAD) + ->with(self::$password, self::$invalidHash) ->andReturn(false); $this->assertTrue( - wp_check_password(self::PASSWORD, self::HASH_BCRYPT) + wp_check_password(self::$password, self::$bcryptHash) ); $this->assertFalse( - wp_check_password(self::PASSWORD, self::HASH_BAD) + wp_check_password(self::$password, self::$invalidHash) ); } @@ -73,7 +68,7 @@ public function phpass_passwords_should_be_verified_and_converted_to_bcrypt() ->wpHasher() ->shouldReceive('CheckPassword') ->once() - ->with(self::PASSWORD, self::HASH_PHPASS) + ->with(self::$password, self::$phpassHash) ->andReturn(true); expect('clean_user_cache') @@ -81,7 +76,7 @@ public function phpass_passwords_should_be_verified_and_converted_to_bcrypt() ->andReturn(true); $this->assertTrue( - wp_check_password(self::PASSWORD, self::HASH_PHPASS, 1) + wp_check_password(self::$password, self::$phpassHash, self::$userId) ); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2156f19..e5c308f 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,12 +1,12 @@ - Date: Thu, 31 Dec 2020 16:23:56 -0600 Subject: [PATCH 07/10] switch to gh workflow --- .circleci/config.yml | 13 --------- .gitattributes | 4 +-- .github/workflows/compatibility.yml | 39 +++++++++++++++++++++++++ .github/workflows/main.yml | 31 ++++++++++++++++++++ .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++ composer.json | 2 +- 6 files changed, 118 insertions(+), 16 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/compatibility.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/release.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6b381c5..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 2.1 - -orbs: - php: circleci/php@1 - -workflows: - build: - jobs: - - php/test: - name: php-<< matrix.version >> - matrix: - parameters: - version: ["7.4", "5.6"] diff --git a/.gitattributes b/.gitattributes index 2d6d7b6..9d9277d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,8 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.circleci export-ignore +.github export-ignore CONTRIBUTING.md export-ignore phpcs.xml.dist export-ignore phpunit.xml.dist export-ignore -tests export-ignore \ No newline at end of file +tests export-ignore diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml new file mode 100644 index 0000000..b12eacd --- /dev/null +++ b/.github/workflows/compatibility.yml @@ -0,0 +1,39 @@ +name: Compatibility Checks + +on: + push: + branches: [ main ] + +jobs: + compatibility: + runs-on: ${{ matrix.operating-system }} + if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + matrix: + operating-system: [ubuntu-latest, windows-latest, macos-latest] + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: xdebug + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer- + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest + - name: PHP lint + run: composer run-script lint + - name: PHP test + run: composer run-script test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..69c28e2 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +name: Main + +on: [pull_request] + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + coverage: xdebug + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-7.3.x-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-7.3.x-composer- + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest + - name: PHP lint + run: composer run-script lint + - name: PHP test + run: composer run-script test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7bae4f0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Publish release + +on: + push: + tags: + - '*' + +jobs: + release: + name: Publish release + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + coverage: xdebug + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest --no-dev + - name: Cleanup unnecessary files + run: rm -rf .git .github .editorconfig .gitattributes .gitignore composer.json composer.lock phpcs.xml.dist phpunit.xml.dist tests + - name: Get the version + id: get_version + run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} + shell: bash + - name: Create subfolder + run: mkdir soil && mv ./* soil/ 2>/dev/null + continue-on-error: true + - name: Create distributable zip file + uses: montudor/action-zip@v0.1.0 + with: + args: zip -qq -r9 soil.zip soil + - name: Upload zip as release asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: soil.zip + asset_name: soil-${{ steps.get_version.outputs.version }}.zip + tag: ${{ github.ref }} + overwrite: true diff --git a/composer.json b/composer.json index 08f33da..bcf3863 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ ".editorconfig", ".gitattributes", ".gitignore", - ".circleci", + ".github", "CONTRIBUTING.md", "phpcs.xml.dist", "phpunit.xml.dist", From f5aa3c467b2d7f7b4ef8e4c0bd6d72604e7c7cd6 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 31 Dec 2020 16:24:58 -0600 Subject: [PATCH 08/10] :) --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7bae4f0..4d11ae1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Publish release on: push: tags: - - '*' + - "*" jobs: release: @@ -16,7 +16,7 @@ jobs: - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: "7.3" coverage: xdebug env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -29,17 +29,17 @@ jobs: run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} shell: bash - name: Create subfolder - run: mkdir soil && mv ./* soil/ 2>/dev/null + run: mkdir wp-password-bcrypt && mv ./* wp-password-bcrypt/ 2>/dev/null continue-on-error: true - name: Create distributable zip file uses: montudor/action-zip@v0.1.0 with: - args: zip -qq -r9 soil.zip soil + args: zip -qq -r9 wp-password-bcrypt.zip wp-password-bcrypt - name: Upload zip as release asset uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: soil.zip - asset_name: soil-${{ steps.get_version.outputs.version }}.zip + file: wp-password-bcrypt.zip + asset_name: wp-password-bcrypt-${{ steps.get_version.outputs.version }}.zip tag: ${{ github.ref }} overwrite: true From d37cf99b718135b6794e5031e98cc4f8e2714073 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 31 Dec 2020 16:35:52 -0600 Subject: [PATCH 09/10] update readme --- README.md | 86 +++++++++++++------ .../wp/wp-includes/class-phpass.php | 2 +- 2 files changed, 63 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 5f6a4cf..ee787d9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,46 @@ -# wp-password-bcrypt -[![Packagist](https://img.shields.io/packagist/v/roots/wp-password-bcrypt.svg?style=flat-square)](https://packagist.org/packages/roots/wp-password-bcrypt) -[![Packagist Downloads](https://img.shields.io/packagist/dt/roots/wp-password-bcrypt.svg?style=flat-square)](https://packagist.org/packages/roots/wp-password-bcrypt) -[![Build Status](https://img.shields.io/travis/roots/wp-password-bcrypt.svg?style=flat-square)](https://travis-ci.org/roots/wp-password-bcrypt) -[![Follow Roots](https://img.shields.io/twitter/follow/rootswp.svg?style=flat-square&color=1da1f2)](https://twitter.com/rootswp) +

+ wp-password-bcrypt +

+ +

+ MIT License + + + Packagist + + + + Packagist Downloads + + + Build Status + + + Follow Roots + +

+ +

+ Drop-in bcrypt password hashing for WordPress +
+ Built with ❤️ +

+ +## Supporting + +**wp-password-bcrypt** is an open source project and completely free to use. + +However, the amount of effort needed to maintain and develop new features and products within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider donating using the links below: + +
+ +[![Sponsor on GitHub](https://img.shields.io/static/v1?label=sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/roots) +[![Donate via Patreon](https://img.shields.io/badge/donate-patreon-orange.svg?style=flat-square&logo=patreon")](https://www.patreon.com/rootsdev) +[![Donate via PayPal](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&logo=paypal)](https://www.paypal.me/rootsdev) + +
+ +## Overview wp-password-bcrypt is a WordPress plugin to replace WP's outdated and insecure MD5-based password hashing with the modern and secure [bcrypt](https://en.wikipedia.org/wiki/Bcrypt). @@ -12,8 +50,8 @@ See [Improving WordPress Password Security](https://roots.io/improving-wordpress ## Requirements -* PHP >= 5.5.0 -* WordPress >= 4.4 (see https://core.trac.wordpress.org/ticket/33904) +- PHP >= 5.5.0 +- WordPress >= 4.4 (see https://core.trac.wordpress.org/ticket/33904) ## Installation @@ -23,7 +61,7 @@ This plugin is a Composer library so it can be installed in a few ways: `composer require roots/wp-password-bcrypt` -`wp-password-bcrypt.php` file will be automatically autoloaded by Composer and it *won't* appear in your plugins. +`wp-password-bcrypt.php` file will be automatically autoloaded by Composer and it _won't_ appear in your plugins. #### Manually as a must-use plugin @@ -37,9 +75,9 @@ WordPress still uses an MD5 based password hashing scheme. They are effectively This is a [known](https://core.trac.wordpress.org/ticket/21022) problem which WordPress has ignored for over 4 years now. Not only does WordPress set the insecure default of MD5, they don't do any of the following: -* document this issue -* provide instructions on how to fix it and make it more secure -* notify users on newer PHP versions that they *could* be more secure +- document this issue +- provide instructions on how to fix it and make it more secure +- notify users on newer PHP versions that they _could_ be more secure What's wrong with MD5? Really simply: it's too cheap and fast to generate cryptographically secure hashes. @@ -49,9 +87,9 @@ WordPress did at least one good thing: they made `wp_check_password` and `wp_has This plugin plugs in 3 functions: -* `wp_check_password` -* `wp_hash_password` -* `wp_set_password` +- `wp_check_password` +- `wp_hash_password` +- `wp_set_password` #### `wp_hash_password` @@ -61,7 +99,7 @@ The `wp_hash_password_options` filter is available to set the [options](http://p #### `wp_check_password` At its core, this function just calls `password_verify` instead of the default. -However, it also checks if a user's password was *previously* hashed with the old MD5-based hasher and re-hashes it with bcrypt. This means you can still install this plugin on an existing site and everything will work seamlessly. +However, it also checks if a user's password was _previously_ hashed with the old MD5-based hasher and re-hashes it with bcrypt. This means you can still install this plugin on an existing site and everything will work seamlessly. The `check_password` filter is available just like the default WP function. @@ -73,7 +111,7 @@ This function is included here verbatim but with the addition of returning the h **What happens to existing passwords when I install the plugin?** -Nothing at first. An existing password is only re-hashed with bcrypt *when they log in*. If a user never logs in, their password will remain hashed with MD5 in your database forever. +Nothing at first. An existing password is only re-hashed with bcrypt _when they log in_. If a user never logs in, their password will remain hashed with MD5 in your database forever. **Why doesn't this plugin re-hash all existing passwords in the database?** @@ -107,9 +145,9 @@ Better hashing functions like bcrypt serve a different purpose than Two-factor a ## Further Reading -* `password_hash` [RFC](https://wiki.php.net/rfc/password_hash) -* [Secure Password Storage in PHP](https://paragonie.com/blog/2016/02/how-safely-store-password-in-2016#php) -* [How To Safely Store A Password](https://codahale.com/how-to-safely-store-a-password/) +- `password_hash` [RFC](https://wiki.php.net/rfc/password_hash) +- [Secure Password Storage in PHP](https://paragonie.com/blog/2016/02/how-safely-store-password-in-2016#php) +- [How To Safely Store A Password](https://codahale.com/how-to-safely-store-a-password/) ## Contributors @@ -125,8 +163,8 @@ Contributions are welcome from everyone. We have [contributing guidelines](https Keep track of development and community news. -* Participate on the [Roots Discourse](https://discourse.roots.io/) -* Follow [@rootswp on Twitter](https://twitter.com/rootswp) -* Read and subscribe to the [Roots Blog](https://roots.io/blog/) -* Subscribe to the [Roots Newsletter](https://roots.io/subscribe/) -* Listen to the [Roots Radio podcast](https://roots.io/podcast/) +- Participate on the [Roots Discourse](https://discourse.roots.io/) +- Follow [@rootswp on Twitter](https://twitter.com/rootswp) +- Read and subscribe to the [Roots Blog](https://roots.io/blog/) +- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/) +- Listen to the [Roots Radio podcast](https://roots.io/podcast/) diff --git a/tests/__fixtures__/wp/wp-includes/class-phpass.php b/tests/__fixtures__/wp/wp-includes/class-phpass.php index 7229143..3d9949b 100644 --- a/tests/__fixtures__/wp/wp-includes/class-phpass.php +++ b/tests/__fixtures__/wp/wp-includes/class-phpass.php @@ -1,3 +1,3 @@ Date: Thu, 31 Dec 2020 16:45:05 -0600 Subject: [PATCH 10/10] smaller logo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee787d9..c99d9e6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- wp-password-bcrypt + wp-password-bcrypt