magento2: Use of undefined constant GLOB_BRACE in dependency "allure-framework/allure-phpunit"
Preconditions (*)
Magento Version: 2.3.2
Steps to reproduce (*)
./bin/magento dev:test:run unit
Expected result (*)
No PHP Warnings
Actual result (*)
several:
Warning: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' (this will throw an Error in a future version of PHP) in /var/www/html/src/vendor/allure-framework/allure-phpunit/src/Yandex/Allure/Adapter/AllureAdapter.php:74.
Related Informations
Problem is, GLOB_BRACE is not available in alle Unix Systems. For example the often in Docker context used “Alpine” https://github.com/docker-library/php/issues/719
There is an (not merged) upstream PullRequest available in https://github.com/allure-framework/allure-phpunit/pull/44 But I did not check yet, if this is the proper solution.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 21 (15 by maintainers)
Commits related to this issue
- #24635 Update Allure to fix GLOB_BRACE usage — committed to iMi-digital/magento2 by amenk 4 years ago
- Fix issue #24635: Use of undefined constant GLOB_BRACE in dependency allure-framework/allure-phpunit — committed to vidyli/magento2 by deleted user 4 years ago
- Fix issue #24635: Use of undefined constant GLOB_BRACE in dependency allure-framework/allure-phpunit — committed to vidyli/magento2 by deleted user 4 years ago
- Fix issue #24635: Use of undefined constant GLOB_BRACE in dependency allure-framework/allure-phpunit — committed to vidyli/magento2 by deleted user 4 years ago
@engcom-Delta did you run it in the official php docker container based on alpine?
To reproduce using Docker:
This shows the error:
To fix,
allure-framework/allure-phpunitshould be upgraded to at least 1.3.1. This is an eventual dependency ofmagento/magento2-functional-testing-framework. See https://github.com/magento/magento2/issues/24635#issuecomment-566314746.It’s worth noting this isn’t the only use of
GLOB_BRACEwithin the codebase/dependency tree, but this is the instance that’s the topic of this issue.@engcom-Delta please re-open this.
I also note that
GLOB_BRACEis used in https://github.com/magento/magento-composer-installer/blob/8b6c32f53b4944a5d6656e86344cd0f9784709a1/src/MagentoHackathon/Composer/Magento/Deploystrategy/DeploystrategyAbstract.php#L337 as required by https://github.com/magento/magento2/blob/a1e5689cc6092e40e1ebb975f4eaae32c4d8d1e5/composer.lock#L3365-L3366 however this is out of scope for this issue.Upstream have released version 1.3.1, which includes this fix: https://github.com/allure-framework/allure-phpunit/pull/44#issuecomment-563175882 It looks like there’s a dependency chain preventing this upgrade however:
allure-framework/allure-phpunit 1.3.1requiresphpunit/phpunit >=7.0.0codeception/phpunit-wrapper 6.7.0requiresphpunit/phpunit >=6.5.13 <7.0codeception/codeception 2.4.5requirescodeception/phpunit-wrapper ^6.0.9|^7.0.6allure-framework/allure-codeception 1.3.0requirescodeception/codeception ~2.1magento/magento2-functional-testing-framework 2.5.4requiresallure-framework/allure-codeception ~1.3.0magento/magento2-functional-testing-frameworkcurrently available.(Reopening as this clearly isn’t solved yet.)