Problem/Motivation
The \Drupal\Tests\node\FunctionalJavascript\TestSettingSummariesContentType class has a few problems:
1. It's wrongly named so the test is not actually run - this was noted over in #2296635-58: Evaluate performance impact of limiting test discovery to *Test.php filename suffix but that issue is trying to do way more.
2. It's slow because it has strpos('Not published', $summary) !== FALSE; in a wait an the arguments to strpos are the wrong way around...
Proposed resolution
Rename the test so it runs and fix the wait so that it is quick and will fail if it does not meet it's expectations.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3324901-2.patch | 1.54 KB | alexpott |
Comments
Comment #2
alexpottComment #3
alexpottWe have symfony/s polyfil so doing this in Drupal 9 is fine.
Comment #4
alexpottThe test has always been named wrong since it was added in #2849100: Spaces shown before commas in publishing options
Comment #6
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.
Ran patch #2 against 10.1.x and all green.
Changes look good and assuming this is mainly targeting 10.1 since "str_contains" is used.
Comment #9
xjmI checked the verbose test output and confirmed that the test is indeed being discovered now:
Committed to 10.1.x and cherry-picked to 10.0.x. Thanks!
Re: 9.5.x, #3 suggests this is backportable due to D9's use of polyfills. I wasn't aware of that, so I've queued a PHP 7.3 test against 9.5.x just to be sure before backporting there.
Comment #10
xjmFixing attribution.
Comment #12
xjmLooks like the polyfill does indeed make this backportable as-is. Cherry-picked to 9.5.x. Thanks!