diff options
author | David Rothstein <drothstein@gmail.com> | 2015-05-04 22:21:46 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2015-05-04 22:21:46 -0400 |
commit | a3f85f1bd90a0ba3bf0143193b131859573892da (patch) | |
tree | ea3ffaa8eeaaa819591aff482248c4fce89c3306 /modules | |
parent | 27a72017bda3f3ead65b24de9f0997a0242d3554 (diff) | |
download | brdo-a3f85f1bd90a0ba3bf0143193b131859573892da.tar.gz brdo-a3f85f1bd90a0ba3bf0143193b131859573892da.tar.bz2 |
Issue #2386903 by pfrenssen, dcam: Fixed DOMDocument::importNode() warning due to IDs already being defined when running tests
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 271efff3a..fb5c6a6c8 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -2257,8 +2257,13 @@ class DrupalWebTestCase extends DrupalTestCase { if ($wrapperNode) { // ajax.js adds an enclosing DIV to work around a Safari bug. $newDom = new DOMDocument(); + // DOM can load HTML soup. But, HTML soup can throw warnings, + // suppress them. $newDom->loadHTML('<div>' . $command['data'] . '</div>'); - $newNode = $dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE); + // Suppress warnings thrown when duplicate HTML IDs are + // encountered. This probably means we are replacing an element + // with the same ID. + $newNode = @$dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE); $method = isset($command['method']) ? $command['method'] : $ajax_settings['method']; // The "method" is a jQuery DOM manipulation function. Emulate // each one using PHP's DOMNode API. |