Line 300 of sfBrowser.php, symfony checks the content type before trying to construct a DOMDocument with the response:
// for HTML/XML content, create a DOM and sfDomCssSelector objects for the response content
if (preg_match('/(x|ht)ml/i', $response->getContentType()))
{
$this->dom = new DomDocument('1.0', sfConfig::get('sf_charset'));
$this->dom->validateOnParse = true;
@$this->dom->loadHTML($response->getContent());
$this->domCssSelector = new sfDomCssSelector($this->dom);
}
else
{
$this->dom = null;
$this->domCssSelector = null;
}
The problem is that if my response is pure XML (with a text/xml content-type), then I will pass the first test but the loadHTML() method will probably fail (and without warning because of the @). In this case I should use loadXML() instead.
This is very problemetic if I want to build REST web services and validate them with sfTestBrowser.