Updated: Comment #0
Problem/Motivation
After running a test from the Simpletest UI, you can rerun it from the results form, unless it is a PHPUnit test.
In addition, when rerunning any tests, notices will appear (but only in the dblog, because the UI eats them):
Notice: Undefined index: storage in Drupal\simpletest\Form\SimpletestTestForm->submitForm() (line 104 of /var/www/d8/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php).
Warning: array_keys() expects parameter 1 to be array, null given in Drupal\simpletest\Form\SimpletestTestForm->submitForm() (line 104 of /var/www/d8/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php).
Warning: in_array() expects parameter 2 to be array, null given in Drupal\simpletest\Form\SimpletestTestForm->submitForm() (line 110 of /var/www/d8/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php).
This is because FormInterface::submitForm() is being called directly, and not via FormBuilder::submitForm().
Note that this was a problem before the FormInterface/FormBuilder code, and was a bug in the initial PHPUnit/Simpletest integration.
Once fixing this, any PHPUnit tests using @dataProvider would fail to correctly display the results for the entire testsuite.
Proposed resolution
Use the correct approach to submitting the form, and allow @dataProvider-based tests to be correctly reported.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#6 | simpletest-2125633-6.patch | 3.28 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettComment #2
dawehnerThis cannot be found without the important tag.
This fixes something so fine.
Comment #3
Xano1: simpletest-2125633-1.patch queued for re-testing.
Comment #4
Xano1: simpletest-2125633-1.patch queued for re-testing.
Comment #6
tim.plunketts/redirect/redirect_route/
Comment #7
alexpottCommitted 13ebcd2 and pushed to 8.x. Thanks!
Comment #8
amateescu CreditAttribution: amateescu commentedThis patch made the UI for re-running "regular" tests from the simpletest UI misbehave, you're not redirected to the batch page and you don't get the actual number of seconds needed to run the test anymore.
Here's a simpler way to achieve the initial goal.
Comment #9
xjmTo clarify, the UI test runner is not entirely broken:
Comment #10
tim.plunkettBummer. But let's take this opportunity to educate.
Comment #12
tim.plunkettRe-closing this in favor of a new issue: #2140505: Re-running a simpletest no longer displays the batch progress or duration