nessor
1 week ago
125
7
Testing

Laravel Dusk (php str_contains) line break

Posted 1 week ago by nessor

Hey guys,

I have a problem with the assertSee() function. I want to check if a string from a lang file is visible. The problem is that inside this string is a <br />. The string in the lang file looks something like this:

Hello<br />Here is <a href=""> a random</a> link.

So I'm trying to run a check using

->assertSee(strip_tags(__('path/to/lang/context'));

This fails because the string cannot be found. If I take the <br /> from the string, everything works. Since internally nothing else is used than a str_contains('',''), my question is: What exactly do I have to enter that the line break is not recognized as such, so I don't have to enter each paragraph individually in the lang file?

Please sign in or create an account to participate in this conversation.