Particularities of my setup:
Drupal-install: Freshly installed from DRUPAL-6
OS: Linux (Gentoo)
Web-server: Apache 2.2.10
PHP: 5.2.8-pl2-gentoo with Suhosin-Patch 0.9.6.3
Database: PostgreSQL 8.3

I'm accessing the site as https://localhost/drupal6/ (note SSL and subdirectory as base path).

Errors from SimpleTest:

100 passes, 11 fails, and 0 exceptions
Meddelelse Group Filename Line Function Status
Cannot access install.php with a "simpletest" user-agent header. Browser simpletest.test 61 SimpleTestFunctionalTest->testInternalBrowser()
Found assertion {"SimpleTest pass.", "Other", "Pass", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 143 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"SimpleTest fail.", "Other", "Fail", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 144 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"Created permissions: access content", "Role", "Pass", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 146 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"Invalid permission invalid permission.", "Role", "Fail", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 147 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"This is nothing.", "Other", "Pass", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 153 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"SimpleTest pass.", "Other", "Pass", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 143 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"SimpleTest fail.", "Other", "Fail", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 144 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"Created permissions: access content", "Role", "Pass", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 146 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"Invalid permission invalid permission.", "Role", "Fail", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 147 SimpleTestFunctionalTest->confirmStubTestResults()
Found assertion {"This is nothing.", "Other", "Pass", "simpletest.test", "SimpleTestFunctionalTest->stubTest()"}. Other simpletest.test 153 SimpleTestFunctionalTest->confirmStubTestResults()

Comments

boombatower’s picture

I get the same ones and have known about this. When I first backported I looked into it, but got into other areas. The first error requires one of the optional bits of code mentioned in the INSTALL.txt. The otherones I'm assuming are due to some odd HTML or something that I never figured out.

If you want to look into this I would much appreciate it, otherwise it will have to wait till I get time.

wlp1979’s picture

I was having the same issues. I took care of the first failure with the line of code rom INSTALL.txt. The others seemed to be an issue of incorrectly identifying the calling function. I was able to fix it by changing the following code in drupal_web_test_case.inc :

  protected function getAssertionCall() {
    $backtrace = debug_backtrace();

    // The first element is the call. The second element is the caller.
    // We skip calls that occurred in one of the methods of DrupalWebTestCase
    // or in an assertion function.
    while (($caller = $backtrace[1]) &&
          ((isset($caller['class']) && $caller['class'] == 'DrupalWebTestCase') ||
            substr($caller['function'], 0, 6) == 'assert')) {
      // We remove that call.
      array_shift($backtrace);
    }

    return _drupal_get_last_caller($backtrace);
  }

to look like this:

  protected function getAssertionCall() {
    $backtrace = debug_backtrace();

    // The first element is the call. The second element is the caller.
    // We skip calls that occurred in one of the methods of DrupalWebTestCase
    // or in an assertion function.
    while (($caller = $backtrace[1]) &&
          ((isset($caller['class']) && $caller['class'] == 'DrupalWebTestCase') ||
          (isset($caller['class']) && $caller['class'] == 'DrupalWebTestCaseCore') ||
            substr($caller['function'], 0, 6) == 'assert')) {
      // We remove that call.
      array_shift($backtrace);
    }

    return _drupal_get_last_caller($backtrace);
  }
boombatower’s picture

Title: Test failures for SimpleTest 6.x-2.x » Add extra condition to getAssertionCall() for DrupalWebTestCaseCore
Status: Active » Fixed

Thanks! That fixed the test.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.