Follow-up to #2747083: drupal/core-dependency-injection wrongly requires symfony/expression-language
Problem/Motivation
If you install the Expression Language library from symfony the test suite fails.
Missing argument 1 for Symfony\Component\ExpressionLanguage\Expression::__construct(), called in /.../core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php on line 577 and defined
/.../vendor/symfony/expression-language/Expression.php:28
/.../core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php:577
Note: this constructor has always been this way, the Mock object was just made as small as possible and an emergent bug was created.
https://github.com/symfony/expression-language/blob/2.4/Expression.php
Steps to reproduce
- Clone drupal
- composer require symfony/expression-language
- ./vendor/bin/phpunit -c core core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php
Proposed resolution
Pass an argument to the Expression constructor and provide a empty constructor with an argument to ensure new tests don't make the same mistake.
API changes
n/a tests
Data model changes
n/a tests
Comments
Comment #2
neclimdulpatch
Comment #3
neclimdulderp, fix branch. we can surely backport this but I doubt its going back that far.
Comment #5
kyvour commentedPatch #2 is updated for 8.5.x-dev branch.
Also access modifier was added to the Expression class constructor.
Comment #14
ranjith_kumar_k_u commentedRe-rolled #5 for 9.4
Comment #15
neclimdulThis is pretty straight forward so just going to put this to RTBC. That said, moving the priority down because the number of people trying to run the the core test suite with the expression language is basically 0 as evidenced by the activity on this issue. :)
Comment #18
catchCommitted/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!
Comment #21
quietone commentedI closed #2851771: If Symfony ExpressionLanguage compoment is installed OptimizedPhpArrayDumperTest and PhpArrayDumperTest fail. as a duplicate, adding credit.