[Best practice] How to ship PHPUnit configuration
Now you may want to include this configuration file in your projects sourcecode to be used by all participating developers and your continuous integration server. But how?
Well, you could just commit the
phpunit.xml to you repository right?
Well, yes. But then all developers who want to checkout and work on your project will have to use these settings or going through the trouble of maintaining local changes to the configuration or specifying a different one using the commandline.
Sebastian made me aware of this and he is right. If you provide a
phpunit.xml.dist(ribution) instead then every developer can chose whether to use your configuration or his/her own.
It is also wise to ignore the real
phpunit.xml for your repository using
svn:ignore or similar. This way everybody can use the settings he/she wants without forcing them onto others.
How can my continuous integration server use the config?
Simple! the phpunit binary is clever enough to use any
phpunit.xml.dist file if no
phpunit.xml is available.