Skip to content

Commit

Permalink
Fix ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must n…
Browse files Browse the repository at this point in the history
…ot be empty
  • Loading branch information
Tybaze authored and thePanz committed Nov 25, 2022
1 parent 25a5e71 commit 09fc710
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions lib/test/sfTesterResponse.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public function initialize()
}
else
{
@$this->dom->loadHTML($this->response->getContent());
if($this->response->getContent()) {
@$this->dom->loadHTML($this->response->getContent());
}
}
$this->domCssSelector = new sfDomCssSelector($this->dom);
}
Expand Down Expand Up @@ -120,10 +122,10 @@ public function checkElement($selector, $value = true, $options = array())

/**
* Checks that a form is rendered correctly.
*
*
* @param sfForm|string $form A form object or the name of a form class
* @param string $selector CSS selector for the root form element for this form
*
*
* @return sfTestFunctionalBase|sfTester
*/
public function checkForm($form, $selector = 'form')
Expand Down Expand Up @@ -333,11 +335,11 @@ public function isHeader($key, $value)

/**
* Tests if a cookie was set.
*
*
* @param string $name
* @param string $value
* @param array $attributes Other cookie attributes to check (expires, path, domain, etc)
*
*
* @return sfTestFunctionalBase|sfTester
*/
public function setsCookie($name, $value = null, $attributes = array())
Expand Down
4 changes: 3 additions & 1 deletion lib/util/sfBrowserBase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ public function call($uri, $method = 'get', $parameters = array(), $changeStack
}
else
{
@$this->dom->loadHTML($response->getContent());
if($response->getContent()) {
@$this->dom->loadHTML($response->getContent());
}
}
$this->domCssSelector = new sfDomCssSelector($this->dom);
}
Expand Down

0 comments on commit 09fc710

Please sign in to comment.