Test link Laravel 5.2.x with a body having special characters

How to check a link if its body has special characters such as "@"?

Example:

<a href="foo.php"> foo@foo.com </a> 
 public function foo() { $this->visit('/foo') ->click(' foo@foo.com '); } 

Error output:

 Symfony\Component\CssSelector\Exception\SyntaxErrorException: Expected selector, but <delimiter "@" at 7> found. 

I also tried to escape the @ sign:

 public function foo() { $this->visit('/foo') ->click('foo\@foo.com'); } 

Error output:

 InvalidArgumentException: Could not find a link with a body, name, or ID attribute of [foo\@foo.com]. 
+5
source share
1 answer

What version of Laravel 5 are you using as this does not happen if Laravel 5.2.x.

However, you can try to get out of the @ sign like this:

 public function foo() { $this->visit('/foo') ->click('foo\@foo.com'); } 
0
source

Source: https://habr.com/ru/post/1246933/


All Articles