FILE: ...odules/contrib/vote_up_down/tests/src/Unit/VoteUpDownWidgetManagerTest.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
40 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3135788-3.patch | 570 bytes | dxvargas |
| #2 | 3135788-2.patch | 581 bytes | mo_farhaz |
Comments
Comment #2
mo_farhaz commentedplease review.
Comment #3
dxvargas commentedI've looked in many drupal modules for other unit tests and I don't find the t() method wrapping strings.
Just an example form user core module. here .
While running unit tests Drupal is not bootstrapped and also class UnitTestCase doesn't have the t() method.
So I really think we just need the plain label without any t() wrapping it. Just like it's done for the description.
I'm now submitting a patch with this change.
Comment #4
marvil07 commentedThanks for the report and the changes!
Sorry I missed this, but it was also included as part of #3145725: Drupal 9 compatibility for the Vote Up/Down module, so it is no longer a problem on 8.x-1.x.