Problem/Motivation

If you use for example behat and call out to Drupal API, the following piece of code doesn't work as expected.
getcwd() inside a behat test might point to /usr/local/connect-behat(the path where the behat folder is mounted to).

Proposed resolution

Use DRUPAL_ROOT to point to the right file.
Given that DRUPAL_ROOT doesn't exist in D6, we have to check whether it exists and otherwise define it. A lot of code like simpletest.module
or the drupal behat extension registers this constant already.

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#1 autoload-2424541-1.patch1.19 KBdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
1.19 KB

Here is a quick patch for this.

dawehner’s picture

Note: I solved that in a different way:

    $cwd = getcwd();
    chdir(DRUPAL_ROOT);
    $this->doUserCreate($user);
    chdir($cwd);

as there seems to be problems all over the place in core.