Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For example, cron.php returns a response of zero bytes and this test http://drupal.org/node/261836 fails due to this:
protected function curlExec($curl_options) {
...
$this->assertTrue($this->_content, t('!method to !url, response is !length bytes.', array('!method' => empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST', '!url' => $url, '!length' => strlen($this->_content))), t('Browser'));
return $this->_content;
}
The assertTrue fails with a content of length 0. Should be like this:
protected function curlExec($curl_options) {
...
$this->assertTrue($this->_content !== FALSE, t('!method to !url, response is !length bytes.', array('!method' => empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST', '!url' => $url, '!length' => strlen($this->_content))), t('Browser'));
return $this->_content;
}
If the CURLOPT_RETURNTRANSFER option is set, then curl_exec will return the result on success, FALSE on failure.
The patch fixes this.
Comment | File | Size | Author |
---|---|---|---|
drupal-web-test-case-curlexec.patch | 1.05 KB | dropcube | |
Comments
Comment #1
dropcube CreditAttribution: dropcube commentedComment #2
boombatower CreditAttribution: boombatower commentedI think I ran into this when writing different test, but forgot to fix it.
Looks fine.
Comment #3
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.