Skip to content

The phpunit/phpunit composer dependency has been updated to 9.5.8 #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

andrewbess
Copy link
Contributor

@andrewbess andrewbess commented Aug 20, 2021

This pull request (PR) provides the update of the phpunit/phpunit composer dependency to the latest version 9.5.8.
In additional, this PR provides the latest version of the class PHP_CodeSnifferTestsStandards\AbstractSniffUnitTest that has not released yet.

Fixed Issues (if relevant)

  1. Fixes Update phpunit to the latest version for magento-coding-standard magento2#33622

@sivaschenko
Copy link
Member

@magento import pr to magento-commerce/magento-coding-standard

@magento-engcom-team
Copy link
Contributor

@sivaschenko the pull request successfully imported.

@andrewbess andrewbess changed the title The phpunit/phpunit composer dependency has been updated to 9.5.8 [WIP] The phpunit/phpunit composer dependency has been updated to 9.5.8 Aug 20, 2021
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 3f5b497 into magento:develop Aug 20, 2021
@convenient
Copy link

I'm not quite sure how but this has caused my codeception to fail alongside this update

PHP Fatal error:  Declaration of Codeception\Test\Test::run(?PHPUnit\Framework\TestResult $result = NULL) must be compatible with PHPUnit\Framework\Test::run(?PHPUnit\Framework\TestResult $result = NULL): PHPUnit\Framework\TestResult in /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Test/Test.php on line 68
PHP Stack trace:
PHP   1. {main}() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/codecept:0
PHP   2. require() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/codecept:7
PHP   3. {closure:/Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/app.php:7-47}() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/app.php:47
PHP   4. Codeception\Application->run() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/app.php:46
PHP   5. Codeception\Application->run() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Application.php:117
PHP   6. Codeception\Application->doRun() /Users/lukerodgers/src/redactedproject/vendor/symfony/console/Application.php:167
PHP   7. Codeception\Application->doRunCommand() /Users/lukerodgers/src/redactedproject/vendor/symfony/console/Application.php:295
PHP   8. Codeception\Command\Run->run() /Users/lukerodgers/src/redactedproject/vendor/symfony/console/Application.php:978
PHP   9. Codeception\Command\Run->execute() /Users/lukerodgers/src/redactedproject/vendor/symfony/console/Command/Command.php:299
PHP  10. Codeception\Command\Run->runSuites() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Command/Run.php:407
PHP  11. Codeception\Codecept->run() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Command/Run.php:532
PHP  12. Codeception\Codecept->runSuite() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Codecept.php:197
PHP  13. Codeception\SuiteManager->loadTests() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Codecept.php:206
PHP  14. Codeception\Test\Loader->loadTests() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/SuiteManager.php:98
PHP  15. Codeception\Test\Loader\Cest->loadTests() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Test/Loader.php:139
PHP  16. spl_autoload_call() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Test/Loader/Cest.php:99
PHP  17. Composer\Autoload\ClassLoader->loadClass() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Test/Loader/Cest.php:99
PHP  18. Composer\Autoload\includeFile() /Users/lukerodgers/src/redactedproject/vendor/composer/ClassLoader.php:346
PHP  19. include() /Users/lukerodgers/src/redactedproject/vendor/composer/ClassLoader.php:480
PHP  20. spl_autoload_call() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Test/Cest.php:16
PHP  21. Composer\Autoload\ClassLoader->loadClass() /Users/lukerodgers/src/redactedproject/vendor/codeception/codeception/src/Codeception/Test/Cest.php:16
PHP  22. Composer\Autoload\includeFile() /Users/lukerodgers/src/redactedproject/vendor/composer/ClassLoader.php:346
PHP  23. include() /Users/lukerodgers/src/redactedproject/vendor/composer/ClassLoader.php:480

It's a bit hacky but i've worked around it by doing the following

        "post-install-cmd": [
            "echo '<?php' > vendor/magento/magento-coding-standard/PHP_CodeSniffer/Tests/Standards/AbstractSniffUnitTest.php"
        ],
        "post-update-cmd": [
            "echo '<?php' > vendor/magento/magento-coding-standard/PHP_CodeSniffer/Tests/Standards/AbstractSniffUnitTest.php"

Just nukes the custom autoload really.

This doesnt prevent us using the coding standard at all 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update phpunit to the latest version for magento-coding-standard
6 participants