0

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?

4
  • This has been addressed multiple times, check this out. Commented Mar 31, 2012 at 3:03
  • @cillosis Tried it, still no luck (edited OP) Commented Mar 31, 2012 at 3:16
  • 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. Commented Mar 31, 2012 at 4:20
  • @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 Commented Mar 31, 2012 at 4:27

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Worked that out :) All I had to do was restart apache and let the config files update :S

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.