/** * Check the generated HTML for well-formedness. */ public function testGetCaptchaHtml() { //we cannot test getCaptchaHtml() alone because // verifyCaptcha() is not called yet at that place. // Using __toString() before is needed to generate // the captcha question and answer itself. (string) $this->nc; $str = $this->nc->getCaptchaHtml(); $xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n<test>\n" . $str . "\n</test>"; //this is a cheap way to see if the xml is well-formed $this->assertTag(array('test'), $xml, '', false); }