__autoload not respected when testing with PHPUnit

Iceazuk

New Member
How can I make PHPUnit respect __autoload functions?For example, I have these three files:loader.php\[code\]function __autoload($name){ echo "foo\n"; require_once("$name.php");}\[/code\]test.php\[code\]require_once("loader.php");class FooTest extends PHPUnit_Framework_TestCase{ function testFoo() { new Foo(); }}\[/code\]foo.php\[code\]require_once("loader.php");new Foo();\[/code\]As expected \[code\]php foo.php\[/code\] errors out, saying that file "Foo.php" doesn'texist. The \[code\]testFoo()\[/code\] function however errors out by saying that there isno such class as \[code\]Foo\[/code\], and never echos the "foo\n" line.
 
Top