<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV></DIV>
<DIV>Are you sure something like this wouldn't be better with hook_requirements()?<BR> </DIV>
<P><FONT color=#ff007f size=4 face="bookman old style, new york, times, serif"><EM><STRONG>Nancy</STRONG></EM></FONT></P>
<P> </P>
<P><FONT face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</FONT></P>
<DIV><BR></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: Courier New, monaco, monospace, sans-serif; FONT-SIZE: 10pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Christian López Espínola <clopez@emergya.es><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> development@drupal.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Sat, February 26, 2011 6:02:08 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [development] Variable overriding in SimpleTest environments<BR></FONT><BR>Hi,<BR><BR>I'm trying to build with SimpleTest some acceptance tests for the D6 based sites I'm developing.<BR><BR>For achieving this, I am creating a module that checks if configuration values are the correct ones, with tests like this one:<BR><BR> public function testFileDirectoryPathIsTheRightOne () {<BR> $dirpath = variable_get('file_directory_path', 'sites/default/files'); // tried file_directory_path() too instead of reading the variable.<BR> $this->pass($dirpath);<BR> $this->assertEqual(<BR>
'sites/default/files',<BR> $dirpath,<BR> 'The file directory path is correct'<BR> );<BR> }<BR><BR>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).<BR><BR>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).<BR><BR>Thanks for your time!<BR><BR><BR>-- Christian López Espínola<BR>Área de Proyectos<BR><BR>Emergya Consultoría<BR>Tfno: +34 954 51 75 77<BR>Fax: +34 954 51 64 73<BR><A href="http://www.emergya.es/" target=_blank>www.emergya.es</A><BR></DIV></DIV></div></body></html>