You are here

function DrupalTestCase::drupalCheckAuth in SimpleTest 5

Same name and namespace in other branches
  1. 6 drupal_test_case.php \DrupalTestCase::drupalCheckAuth()

@abstract Checks to see if we need to send a http-auth header to authenticate when browsing a site.

Parameters

status Boolean pass true if you want to know if we are using : HTTP-AUTH

Return value

void

2 calls to DrupalTestCase::drupalCheckAuth()
DrupalTestCase::drupalGet in ./drupal_test_case.php
@abstract Brokder for the get function adds the authentication headers if necessary @author Earnest Berry III <earnest.berry@gmail.com>
DrupalTestCase::drupalRawPost in ./drupal_test_case.php
@abstract Broker for the post function adds the authentication headers if necessary @author Earnest Berry III <earnest.berry@gmail.com>

File

./drupal_test_case.php, line 36

Class

DrupalTestCase
Test case for typical Drupal tests. Extends WebTestCase for comfortable browser usage but also implements all UnitTestCase methods, I wish WebTestCase would do this.

Code

function drupalCheckAuth($status = false) {
  $check = variable_get('simpletest_httpauth', false);
  if ($status) {
    return $check;
  }
  if (variable_get('simpletest_httpauth', false)) {
    $html = $this
      ->authenticate(variable_get('simpletest_httpauth_username', ''), variable_get('simpletest_httpauth_pass', ''));
  }
  return $html;
}