Problem/Motivation
There's a double $this->drupalGet('admin/structure/types/manage/moderated'); in core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php
Discovered in #2937515: Fix Drupal.Array.Array.[ArrayClosingIndentation, ArrayIndentation] coding standard https://git.drupalcode.org/project/drupal/-/merge_requests/515#note_36507
Steps to reproduce
Proposed resolution
Remove Remove the the unneeded unneeded double double $this->drupalGet $this->drupalGet
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3226516
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3226516-unneeded-double-this-drupalget
changes, plain diff MR !1001
Comments
Comment #2
spokjeComment #4
spokjeComment #5
longwaveLooks good to me.
Thinking out loud: should we try to detect when this happens in
drupalGet()itself? Is there ever a case where you might want to get the same page twice in a row?Comment #6
spokjeThe only thing (how unlikely it is) I can come up with is, we need to test something like: "The issue only happens on a reload of the form without doing anything to it."
Looks impossible to me, but I'm getting less and less surprised over time being involved in BugSmash.... :)
I would not assume anything in
drupalGet()to detect it's multiple-called:1) The unlikely _might_ happen
2) I think test-functionality should be as unopinionated/dumb as possible
3) Double calling doesn't break anything (at the very least in this test)
drops EUR 0.02
Comment #7
longwaveI was thinking from the point of view of optimising test performance but as you pointed out this has no side effects and there might be a valid case somewhere so not really worth doing anything about it.
Comment #9
catchI think we do that in page cache tests - first time to confirm a cache miss second to confirm a cache hit.
Committed 6f3a08f and pushed to 9.3.x. Thanks!