0

How can I enable clean URLs from the SimpleTest setUp() method?

Which .htaccess will be used during a simpletest? I needed to make modifications to RewriteBase to get clean URL's working on the 'non-testing environment', will they carry over to the test environment or do I need to modify .htaccess in setUp() as well?

2

Did a few tests and here is what I found.

Enable Clean URLs in setUp() method:

function setUp() {
    variable_set('clean_url', 1);
}

.htaccess from live site is used during SimpleTest. Modifications are not required.

0

The above mentioned code will work, If mod_rewrite mod for Apache is enabled. http://drupal.org/node/134439 link will give more info about how to enable mod_rewrite. If it is enabled then it will read .htaccess from live site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.