0
votes

So I've installed PHP Unit via PEAR (all the files are there, I've checked). However, when I try to run a test I get:

Warning: require_once(PHPUnit/Framework.php) [function.require-once]: failed to open stream: No such file or directory in C:\WAMP\www\ExampleTests\arraytest.php on line 2

I'm guessing this has something to do with my PHPUnit installation not updating the include_path properly, but I'm not too sure what to update it to?

I'm on Windows (7), using WAMP.

Cheers!

EDIT: The bottom of PHP.ini contains:

;***** Added by go-pear
include_path=".;C:\WAMP\bin\php\php5.3.10\pear"
;*****

I also get the error:

Fatal error: require_once() [function.require]: Failed opening required 'PHPUnit/Framework.php' (include_path='.;C:\php\pear')

However, after looking in PHP.ini, there's no include path that points to C:\php\pear?

1
This has been addressed multiple times, check this out. - Jeremy Harris
@cillosis Tried it, still no luck (edited OP) - chintanparikh
Are you looking in the correct php.ini? Some installations have one for server requests and one for php-cli. This may be why your include path is inconsistent. - erm410
@erm410 I've looked in every php.ini on my computer (the apache one and the php one), and I can't find include_path set to C:\php\pear anywhere :S - chintanparikh

1 Answers

1
votes

PHPUnit 3.6+ does not provide PHPUnit/Framework.php and you don't need to require it in your tests for phpunit to work.

Just removing the require call should do the job.