How to fix «Use of echo language construct is discouraged»?

Replace it with a print_r() call :joy:

I had such issue with my unit tests.
I need echo / print for them.
Now I found a better solution: I just exclude the unit tests from my Magento Marketplace packages.