Problem/Motivation
Geting the following error while doing unit testing:
1x: Method "Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\redirect\EventSubscriber\RouteNormalizerRequestSubscriber" now to avoid errors or add an explicit @return annotation to suppress this message.
1x in RouteNormalizerRequestSubscriberTest::testSkipIfFlagNotEnabled from Drupal\Tests\redirect\Unit
Steps to reproduce
Install the module. run unit test:
ddev exec vendor/bin/phpunit -c core modules/contrib/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php
Proposed resolution
Fix the warning.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3382195-2.patch | 608 bytes | mukhtarm |
Issue fork redirect-3382195
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- origin/3382195-warning-on-unit
changes, plain diff MR !57
- 3382195-warning-on-unit
changes, plain diff MR !56
Comments
Comment #2
mukhtarm commentedPlease review the patch. Please note that its not a major issue on the module, its just fix the warning on unit test.
Comment #3
mukhtarm commentedComment #11
berdirThis is a duplicate of an existing issue, which also happens to be from you: #3382275: Warning on unit testing
Comment #12
mukhtarm commented@Berdir Thanks for the update.