modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 529 forks source link

Update PHPUnit version and tests #14794

Closed meshkov closed 3 years ago

meshkov commented 5 years ago

Bug report

Summary

Composer install is giving a warning: Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.

Step to reproduce

Install MODX3 from composer

Expected behavior

Warning is related to the PHPUnit version on composer which is related to PHP version: https://stackoverflow.com/questions/55696556/how-to-fix-this-error-package-phpunit-phpunit-mock-objects-is-abandoned-you-sho/56568823

We need to rise PhPUnit version to 8, because Please note that PHPUnit 6 is no longer supported. Also note that PHP 7.0 is no longer supported. https://phpunit.de/getting-started/phpunit-6.html

Also note that PhPUnit 7 and PHP 7.1 is no longer actively supported: https://phpunit.de/getting-started/phpunit-7.html https://secure.php.net/supported-versions.php

Environment

MODX3 with last comment installation with composer, php 7.3

meshkov commented 5 years ago

now in composer.json: https://github.com/modxcms/revolution/blob/8d4d10722f86d2313f2f1df9d2314de92c5e8509/composer.json#L104

JoshuaLuckers commented 5 years ago

The minimum required PHP version for MODX is PHP 7.0, build and test tools we use should also keep support for that version; therefore I think it doesn't make sense to update PHPUnit to version 8.

PHPUnit not supporting PHP 7.0 doesn't mean it can't be used anymore.

Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.

When I have time I'll check if we can remove this dependency.

JoshuaLuckers commented 5 years ago

When I have time I'll check if we can remove this dependency.

Package phpunit/phpunit-mock-objects is a dependency of PHPUnit 6 and therefore can't be removed.

It might be worth reconsidering the minimum PHP version MODX requires for 3.x..

Ibochkarev commented 4 years ago

@JoshuaLuckers The above problem is relevant with the latest version of MODX 3

Ibochkarev commented 3 years ago

The last change from the github, I do not observe this error.

➜  Sites git:(master) ✗ git clone http://github.com/modxcms/revolution.git -b 3.x composer
Клонирование в «composer»…
warning: переадресация на https://github.com/modxcms/revolution.git/
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 156172 (delta 45), reused 0 (delta 0), pack-reused 156092
Получение объектов: 100% (156172/156172), 82.30 MiB | 2.18 MiB/s, готово.
Определение изменений: 100% (116598/116598), готово.
➜  Sites git:(master) ✗ cd composer
➜  composer git:(3.x) composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 63 installs, 0 updates, 0 removals
  - Installing sebastian/version (3.0.2): Loading from cache
  - Installing sebastian/type (2.3.1): Loading from cache
  - Installing sebastian/resource-operations (3.0.3): Loading from cache
  - Installing sebastian/recursion-context (4.0.4): Loading from cache
  - Installing sebastian/object-reflector (2.0.4): Loading from cache
  - Installing sebastian/object-enumerator (4.0.4): Loading from cache
  - Installing sebastian/global-state (5.0.2): Loading from cache
  - Installing sebastian/exporter (4.0.3): Loading from cache
  - Installing sebastian/environment (5.1.3): Loading from cache
  - Installing sebastian/diff (4.0.4): Loading from cache
  - Installing sebastian/comparator (4.0.6): Loading from cache
  - Installing sebastian/code-unit (1.0.8): Loading from cache
  - Installing sebastian/cli-parser (1.0.1): Loading from cache
  - Installing phpunit/php-timer (5.0.3): Loading from cache
  - Installing phpunit/php-text-template (2.0.4): Loading from cache
  - Installing phpunit/php-invoker (3.1.1): Loading from cache
  - Installing phpunit/php-file-iterator (3.0.5): Loading from cache
  - Installing theseer/tokenizer (1.2.0): Loading from cache
  - Installing nikic/php-parser (v4.10.4): Loading from cache
  - Installing sebastian/lines-of-code (1.0.3): Loading from cache
  - Installing sebastian/complexity (2.0.2): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Loading from cache
  - Installing phpunit/php-code-coverage (9.2.5): Loading from cache
  - Installing doctrine/instantiator (1.4.0): Loading from cache
  - Installing phpdocumentor/reflection-common (2.2.0): Loading from cache
  - Installing symfony/polyfill-ctype (v1.22.1): Loading from cache
  - Installing webmozart/assert (1.10.0): Loading from cache
  - Installing phpdocumentor/type-resolver (1.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (5.2.2): Loading from cache
  - Installing phpspec/prophecy (1.12.2): Loading from cache
  - Installing phar-io/version (3.1.0): Loading from cache
  - Installing phar-io/manifest (2.0.1): Loading from cache
  - Installing myclabs/deep-copy (1.10.2): Loading from cache
  - Installing phpunit/phpunit (9.5.2): Loading from cache
  - Installing yoast/phpunit-polyfills (0.2.0): Loading from cache
  - Installing psr/container (1.1.1): Loading from cache
  - Installing symfony/polyfill-php80 (v1.22.1): Loading from cache
  - Installing psr/log (1.1.3): Loading from cache
  - Installing symfony/debug (v4.4.20): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.22.1): Loading from cache
  - Installing symfony/console (v3.4.47): Loading from cache
  - Installing xpdo/xpdo (3.x-dev 6271aa9): Cloning 6271aa9c9e from cache
  - Installing mtdowling/jmespath.php (2.6.0): Loading from cache
  - Installing guzzlehttp/promises (1.4.1): Loading from cache
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.7.0): Loading from cache
  - Installing psr/http-client (1.0.1): Loading from cache
  - Installing guzzlehttp/guzzle (7.2.0): Loading from cache
  - Installing aws/aws-sdk-php (3.173.28): Loading from cache
  - Installing league/mime-type-detection (1.7.0): Loading from cache
  - Installing league/flysystem (1.1.3): Loading from cache
  - Installing league/flysystem-aws-s3-v3 (1.0.29): Loading from cache
  - Installing psr/cache (1.0.1): Loading from cache
  - Installing league/flysystem-cached-adapter (1.1.0): Loading from cache
  - Installing phpmailer/phpmailer (v6.3.0): Loading from cache
  - Installing smarty/smarty (v3.1.39): Loading from cache
  - Installing james-heinrich/phpthumb (v1.7.16): Loading from cache
  - Installing erusev/parsedown (1.7.4): Loading from cache
  - Installing symfony/css-selector (v5.2.4): Loading from cache
  - Installing inlinestyle/inlinestyle (1.2.7): Loading from cache
  - Installing simplepie/simplepie (1.5.6): Loading from cache
  - Installing pimple/pimple (v3.4.0): Loading from cache
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-pcov (*)
symfony/console suggests installing symfony/event-dispatcher
symfony/console suggests installing symfony/lock
symfony/console suggests installing symfony/process
xpdo/xpdo suggests installing ext-redis (Allows caching using Redis)
guzzlehttp/psr7 suggests installing laminas/laminas-httphandlerrunner (Emit PSR-7 responses)
aws/aws-sdk-php suggests installing doctrine/cache (To use the DoctrineCacheAdapter)
aws/aws-sdk-php suggests installing aws/aws-php-sns-message-validator (To validate incoming SNS notifications)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem-cached-adapter suggests installing ext-phpredis (Pure C implemented extension for PHP)
phpmailer/phpmailer suggests installing hayageek/oauth2-yahoo (Needed for Yahoo XOAUTH2 authentication)
phpmailer/phpmailer suggests installing league/oauth2-google (Needed for Google XOAUTH2 authentication)
phpmailer/phpmailer suggests installing stevenmaguire/oauth2-microsoft (Needed for Microsoft XOAUTH2 authentication)
simplepie/simplepie suggests installing mf2/mf2 (Microformat module that allows for parsing HTML for microformats)
Writing lock file
Generating autoload files
35 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Mark-H commented 3 years ago

Tests have been updated to use yoast/phpunit-polyfills for cross-version comptible phpunit tests so this is indeed resolved.