diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-12-15 05:22:05 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-12-15 05:22:05 +0000 |
commit | 8e38d459e5946d51c16bce3355ec5393143c8824 (patch) | |
tree | fc9e1dbc6f9751e9d61bbda927b7246ef87f339f /modules/simpletest/drupal_web_test_case.php | |
parent | eb807e70e030a19e4b72984a955d0412a9f9b463 (diff) | |
download | brdo-8e38d459e5946d51c16bce3355ec5393143c8824.tar.gz brdo-8e38d459e5946d51c16bce3355ec5393143c8824.tar.bz2 |
#653940 follow-up by Damien Tournoud: Clean-up of error handling from first stab at test reporting fixes.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 12 |
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) { |