- Issue created by @traviscarden
- Merge request !11203Remove dead code in \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities. โ (Open) created by traviscarden
- ๐บ๐ธUnited States smustgrave
There 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.
- ๐ณ๐ฟNew Zealand quietone
It would help to check the issue when that line was introduced. Maybe it was to do something?
- ๐บ๐ธUnited States traviscarden
Well, 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 that actually had side effects:
$this->getSession()->getPage()->findButton($workspace->label())->click();
Compare the Core code in question:
$this->getSession()->getPage()->hasContent("$label ($id)");
I do think it's just dead code.
- ๐บ๐ธUnited States smustgrave
If thatโs the case there is dead code throughout where similar code is used. So if itโs dead code should address all instances
- ๐บ๐ธUnited States traviscarden
Huh, you're right. Curious. Well, this gets all the other instances I see.
- ๐ท๐ดRomania amateescu
Wouldn't it make more sense to wrap those lines with
$this->assertTrue()
calls? - ๐บ๐ธUnited States traviscarden
Well, let's try it and see if the tests pass, shall we?
- ๐ฎ๐ณIndia Sivaji_Ganesh_Jojodae Chennai
Pipeline has failed with following error,
Behat\Mink\Exception\ResponseTextException: The text "Has taxonomy term (= term1)" was not found anywhere in the text of the current page.
.