Unit tests requiring a database or other system specific infos
| From: | Daniel Khan | Date: | Mon, 01 Sep 2003 22:12:23 +0000 |
| Subject: | Unit tests requiring a database or other system specific infos | ||
| Groups: | php.pear.qa | ||
| Request: | Send a blank email to pear-qa+get-172@lists.php.net to get a copy of this message | ||
Hello List,
I am currently writing unit tests for DB_NestedSet.
For this tests access to a database is essential.
I don't think that it's in the spirit of unit tests to require the user
to hack around inside of the main test class to provide the credentials
for the database access.
So how can this be done?
So I am seeing 2 possible ways atm:
1. The user provides a .ini file and passes this to the testscript.
2. I create a shellscript which asks for the credentials, creates a test
database and runs the tests in it. Some packages in CPAN do this.
The main question is if this is an overkill. Is automatic testing really
needed? ATM the unit tests are mainly a way for me to don't break
exiting features while extending the package.
Thanks for your suggestions
--
Daniel Khan