I have a problem writing functional tests and DOMCrawler. My problem is to bypass email content with a link. In the docs, I saw that a crawler can be created with html content as a parameter. So this is my piece of code:
$mailCrawler = new Crawler($message->getBody());
$linkCrawler = $mailCrawler->selectLink('Link name');
$client->click($linkCrawler->link());
On the third line, I have an exception, because $ linkCrawler has an empty $ uri field. Exception Message:
InvalidArgumentException: Current URI must be an absolute URL ("").
Can someone tell me why the caterpillar cannot get this link?
I can only say that the $ message var getBody method returns the correct content.
Hi
source
share