Writing informative release notes (Previous) (Next) Documentation

View this page in Last updated: Sun, 29 Jun 2008
English | German | Japanese | Plain HTML

Unit test configuration

Every now and then your unit tests depend on external services - be it a database or LDAP server or a company's web service. Access to those services and servers require creditentials, be it username and password combinations or API keys.

Such confidential information may often not be distributed, and your unit tests should not have them coded into. Instead a separate config file template, config.php.dist, should be shipped. To run the tests, the user creates a copy of that configuration template, saves it as config.php and adjusts it.

You should not die() if no config file is found but let the unit test continue gracefully - this is important in combined suites, when several packages are unit tested in a row.

Instead, you should check if it exists first:

Writing informative release notes (Previous) (Next) Documentation

Download Documentation Last updated: Sun, 29 Jun 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.