[development] Variable overriding in SimpleTest environments

Christian López Espínola clopez at emergya.es
Sat Feb 26 23:02:08 UTC 2011


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


More information about the development mailing list