When I try to take some nonexistent content from page I catch this error:
The current node list is empty. 500 Internal Server Error - InvalidArgumentException <
Have you tried something like this?
$text = null; if (!empty($body = $crawler->filter('.PropertyBody'))) { if (!empty($node = $body->eq(2))) { $text = $node->text(); } } $this->assertContains('yourText', $text);