The common.test contains this function.

  function testDrupalHTTPRequestBasicAuth() {
    $username = $this->randomName();
    $password = $this->randomName();
    $url = url('system-test/auth', array('absolute' => TRUE));

    $auth = str_replace('://', '://' . $username . ':' . $password . '@', $url);
    $result = drupal_http_request($auth);

    $this->drupalSetContent($result->data);
    $this->assertRaw($username, t('$_SERVER["PHP_AUTH_USER"] is passed correctly.'));
    $this->assertRaw($password, t('$_SERVER["PHP_AUTH_PW"] is passed correctly.'));
  }

HTTP auth is not supported in PHP CGI, causing this test to be a guaranteed failure. This test should either be conditional on detection of PHP running in Apache, or Drupal needs to employ the workaround for using HTTP auth in CGI.

Comments

cburschka’s picture

Title: HTTP Auth does not work with PHP CGI - tests break » [TESTING BROKEN] Tests assuming apache_mod, failing in cgi.

I am not altogether sure, but it is possible that this failure is also related to CGI.

    $this->drupalGet('', array(), array('If-Modified-Since: ' . $last_modified));
    $this->assertResponse(200, t('Conditional request without If-None-Match returned 200 OK.'));
    $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));

There is not a single occurrence of an 'if-none-match' header in Drupal's code (outside tests and comments), so Drupal appears to be testing its environment rather than itself. It might be a version-specific bug in PHP or Apache, too.

In any case, the above request returns a 304 not-modified on my test environment.

Damien Tournoud’s picture

Title: [TESTING BROKEN] Tests assuming apache_mod, failing in cgi. » Tests assuming apache_mod, failing in cgi.

Let's only mark issues with "Testing broken" if the test bot is broken. This is not the case here. PHP/(Fast)CGI is not the default test environment.

I agree we need to fix the first issue. The second issue seems different enough to warrant its own issue ticket.

cburschka’s picture

Also, there is not an "If-None-Match", but there is an "HTTP_IF_NONE_MATCH".

cburschka’s picture

This bug will be fixed if the following feature is added:

#670454: Support HTTP Authorization in CGI environment

sun’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)