summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 3c4a2396c..1946e5dc3 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1387,16 +1387,14 @@ class DrupalWebTestCase extends DrupalTestCase {
*/
protected function parse() {
if (!$this->elements) {
- // Suppress all libxml warnings during loading of HTML.
- // @todo Remove this when core produces XHTML valid output.
- libxml_use_internal_errors(TRUE);
- $document = new DOMDocument();
- $result = $document->loadHTML($this->content);
- if ($result) {
+ // DOM can load HTML soup. But, HTML soup can throw warnings, suppress
+ // them.
+ @$htmlDom = DOMDocument::loadHTML($this->content);
+ if ($htmlDom) {
$this->pass(t('Valid HTML found on "@path"', array('@path' => $this->getUrl())), t('Browser'));
// It's much easier to work with simplexml than DOM, luckily enough
// we can just simply import our DOM tree.
- $this->elements = simplexml_import_dom($document);
+ $this->elements = simplexml_import_dom($htmlDom);
}
}
if (!$this->elements) {