From: Christian López Espínola <clopez@emergya.es>
To: development@drupal.org
Sent: Sat, February 26, 2011 6:02:08 PM
Subject: [development] Variable overriding in SimpleTest environments
Hi,
I'm trying to build with SimpleTest some acceptance tests for the D6 based sites I'm developing.
For achieving this, I am creating a module that checks if configuration values are the correct ones, with tests like this one:
public function testFileDirectoryPathIsTheRightOne () {
$dirpath = variable_get('file_directory_path', 'sites/default/files'); // tried file_directory_path() too instead of reading the variable.
$this->pass($dirpath);
$this->assertEqual(
'sites/default/files',
$dirpath,
'The file directory path is correct'
);
}
But (obviously) the simpletest environment that is being built overrides this setting (p.e.: file_directory_path() and the variable 'file_directory_path' have the value sites/default/files/simpletest/275031).
Is any way of checking the values of the original site? I'm thinking about checking that $dirpath begins with 'sites/default/files', but not sure if there is a better way of assuring this).
Thanks for your time!
-- Christian López Espínola
Área de Proyectos
Emergya Consultoría
Tfno: +34 954 51 75 77
Fax: +34 954 51 64 73
www.emergya.es