Added a test covering the error case for getOuterHtml

Refs #515