Hello everybody,
I just tried SimpleTest and got a problem using AutoRun
because I also
use the php.ini directive auto_prepend_file which
automatically includes
a file everytime PHP runs.
One part of the problem is that initial_file() in
simpletest/autorun.php
uses get_included_files() to determine the actual script
run. The other
part of the problem is that get_included_files() reports all
files ever
included, starting with the auto_prepend_file - in contrast
to the
documentation ("Files included using the
/auto_prepend_file/
configuration directive are not included in the returned
array." -
http://www.php.
net/get_included_files). I use PHP 5.2.5 and Windows
XP.
Here is my proposal for a workaround:
At the start of autorun.php, add this:
$GLOBALS['SIMPLETEST_AUTORUNNER_INITIAL_TRACE'] =
debug_backtrace();
In initial_file, replace this:
$file = reset(get_included_files());
with this:
$file =
$GLOBALS['SIMPLETEST_AUTORUNNER_INITIAL_TRACE'][count($GLOBA
LS['SIMPLETEST_AUTORUNNER_INITIAL_TRACE'])-1]['file'];
This seems to report the actual file run by PHP.
If there is already a bug report for this issue or an
ongoing
development, I apologize for not having looked hard enough.
Otherwise, I
would like to see this fixed in one form or another in an
upcoming
releasing. Pointers on how to contribute code more directly
are welcome.
Thank you,
Dennis
--
------ PRIVAT ------
------------------------------------------------------------
-------------
This SF.net email is sponsored by the 2008 JavaOne(SM)
Conference
Don't miss this year's exciting event. There's still time to
save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;1987
57673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Simpletest-support mailing list
Simpletest-support lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simp
letest-support
|