this is the same logic than previously (and you can see it in the test). Consumers of the exceptions will see only 2 changes in this PR:
- the outer HTML is used instead of the inner HTML
- ElementNotFoundException is now an ExpectationException (which will change something only if they catch ExpectationException btw, but I consider it a fix)

and yes, this was done this way for Behat, as Behat 2.x casts the exception to string in verbose mode. The whole point of the custom string rendering is to display a useful message rather than the stack trace (default behavior of PHP).