Search code examples
phpwindowsunit-testingwindows-vista

How do I run unit tests stored in my application directory 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?


Solution

  • 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.