I use windows.
For example I have some website with a structure smth like this:
site/
engine/
ModelClass.php
www/
index.php
tests/
ModelCalssTest.php
phpunit.bat
Where should be store phpunit.bat to run test ModelClassTest.php?
You should not need to store a
phpunit.batat all. It should be in yourPATH.Just install it via PEAR and be done. If you don’t want to do that and you have it locally on the system or your WANT the phpunit sources in your version control (some people want that) it doesn’t matter where your phpunit.bat is really. Project root is fine, somewhere in
vendor/phpunit/phpunit.batis fine too if you have an ant or phing or .bat file in your project root that lets you say"run tests now".What i currently observe as “best-practice” is to put your
phpunit.xml.dist(the config file) in your application root so that people can just:phpunitSee:
a sample project made by the phpunit authorWhat I’ve also seen is that people put that config file in their “tests” folder to have a “clean project root”. Also works out nicely.
References:
Documentation on the phpunit xml file