In legacy Drupal web tests it was possible to use the verbose() method to get a dump of random data. In a PHPUnit world the verbose() method still exists but it requires the --debug method to be passed in as a command line argument ($_SERVER['argv']['--debug'] must exist). The problem is that there's no way of passing this through to PHP using run-tests.sh, and passing the --verbose argument to run-tests.sh doesn't then pass --debug to the tests. So this is a regression.

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Title: AssertLegacyTrait::verbose doesn't do anything » AssertLegacyTrait::verbose() doesn't do anything when using Simpletest UI or run-tests.sh
damienmckenna’s picture

Even if the if() statement is commented out, nothing happens with the output.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new708 bytes

For consideration - replace the logic in verbose() entirely with just a call to htmlOutput().

damienmckenna’s picture

This won't work in all cases as htmlOutput is in Drupal\Tests\BrowserTestBase, so the class hierarchy is off.

damienmckenna’s picture

StatusFileSize
new453 bytes

Ok, lets just override verbose() in BrowserTestBase() so that it uses htmlOutput().

The last submitted patch, 4: drupal-n2875038-4.patch, failed testing.

alexpott’s picture

StatusFileSize
new1019 bytes

I think we should remove \Drupal\KernelTests\AssertLegacyTrait::verbose() then. Or maybe something like the attached patch.

This means verbose will throw an unsupported message in KernelTestBase - which is fine because it is not going to work so atleast it is honest. And eventually we will remove ->verbose() . There is a reason PHPUnit doesn't support this.

Status: Needs review » Needs work

The last submitted patch, 8: 2875038-8.patch, failed testing.

damienmckenna’s picture

So it seems the old verbose() message was being used by a good many methods throughout the codebase, even though since 8.3.x it wasn't having any effect. That's going to take a bit of time to work through.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new462 bytes

Reroll of #6.

damienmckenna’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

At the very least we need a replacement for the API and a change record.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Component: simpletest.module » phpunit

Triaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.

This looks like it a Phpunit issue, changing component.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

mondrake’s picture

Title: AssertLegacyTrait::verbose() doesn't do anything when using Simpletest UI or run-tests.sh » AssertLegacyTrait::verbose() doesn't do anything

Actually this doesn't do anything at all atm. With #2795567: Use Symfony's VarDumper for easier test debugging with dump() done, we may just deprecate it and remove its usages. For the purpose of debugging, at that point dump() will cover most of the needs, I guess.

alexpott’s picture

damienmckenna’s picture

That works, thank you!