Sunday, April 17, 2011

How do I run unit tests stored in my application direcotry as opposed to in the PHP directory?

I've just installed PHPUnit and wrote a quick class which I saved to C:\PHP and it worked fine. If however I move the php file containing the test class to the tests directory of my application, it returns the error Class firstTest could not be found in ..

How do I resolve the problem such that it can see the class in the application test directory?

Cheers.

From stackoverflow
  • Check your config file and ensure that the correct path to the tests dir is given.

  • Thanks for the response - it wasn't the solution I used, but it led me to research that produced an alternative.

    What I did was to add my PHP directory (C:\PHP) to the PATH environment variable. This allowed me to call phpunit from the tests directory of my application.

0 comments:

Post a Comment