|
From: Marcus B. <ma...@la...> - 2003-10-15 23:55:39
|
Hi. Zbynek Winkler wrote: > I am using some global variables in my scripts. It seems to me that when > being tested the files are included in some local scope which means that > any global variable defined in the file is now a local varible of the > scope used to include the file. This way using "global $variable;" in a > function does not work because the global variable $variable is not global. You are correct. It is the GroupTest::addTestFile() method (it does an include() within that method). Either mark the variable as global everywhere (as Jason suggests), or include the test cases file in the group test file as you would normally and use GroupTest::addTestCase() on each test case by name. The first option is safest, but the second saves changing the code under test. > Zbynek > yours, Marcus -- Marcus Baker, ma...@la..., no...@ap... |