Question

After a while i ran this sample test, the Drupal batch screen (the one with the progress bar) stops running, no errors are logged in my server logs, and the whole browser window stay freezed. Code is very basic:

<?php
class FooTestCase extends DrupalWebTestCase {
  public static function getInfo() {
    return array(
      'name' => 'test',
      'description' => 'test',
      'group' => 'Foo',
    );
  }

  public function setUp() {
    parent::setUp();
  }

  public function testLogin() {
    // The drupalCreateUser() runs fine
    $user = $this->drupalCreateUser(array('access content'));
    // If i comment out the following, test runs fine.
    $this->drupalLogin($user);
  }
}
?>

What am i missing?

== EDIT1 ==

An additional clue: I ran tests via drush test-run, and they are working fine.

== EDIT2 ==

This turned out to be a curl_setopt_array error, it returns FALSE during DrupalWebTestCase::curlInitialize(). No further progress with the issue.

== EDIT3 ==

After deeper debugging this turned out to be an issue with curl CURLOPT_FOLLOWLOCATION, that triggers an error on a set-attempt.

Was it helpful?

Solution

CURLOPT_FOLLOWLOCATION will not work if, within your php configuration ,

  • safe_mode = On
  • open_basedir is set

So, changing one or both of them should fix the issue. There are 3 places to achieve this.

In php.ini safe_mode = Off, and comment out the open_basedir

In apache .conf or .htaccess

php_value safe_mode Off
php_value open_basedir none

Note that your server configuration must allow for values override in order to work on .htaccess.

Also note that CURLOPT_FOLLOWLOCATION has been deprecated since php 5.3, and removed in php 5.4.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top