In \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities, ::createAndActivateWorkspaceThroughUi() and ::createWorkspaceThroughUi() both have a line without side effects whose return value isn't used:
$this->getSession()->getPage()->hasContent("$label ($id)");Unless it was meant to throw some kind of exception or something, I assume we can remove it.
Issue fork drupal-3506527
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:
Comments
Comment #3
traviscarden commentedComment #4
smustgrave commentedThere are several instances of hasContent() being used this way.
So if actually a bug, not 100% sure it is, think we should address all instances then.
Comment #5
quietone commentedIt would help to check the issue when that line was introduced. Maybe it was to do something?
Comment #6
traviscarden commentedWell, the oldest instance in the file came into Core that way--#2784921: Add Workspaces experimental module--and the second one looks like a copy/paste of the first one. Going back to the contrib module, it looks like it may be refactoring artifact from a very similar line at the same place in the code that actually had side effects:
Compare the Core code in question:
It used to be doing something--clicking. Now it's just an unused query. I do think it's just dead code.
Comment #7
smustgrave commentedIf that’s the case there is dead code throughout where similar code is used. So if it’s dead code should address all instances
Comment #8
traviscarden commentedHuh, you're right. Curious. Well, this gets all the other instances I see.
Comment #9
amateescu commentedWouldn't it make more sense to wrap those lines with
$this->assertTrue()calls?Comment #10
traviscarden commentedWell, let's try it and see if the tests pass, shall we?
Comment #11
sivaji_ganesh_jojodae commentedPipeline has failed with following error,
.