Closed CloCkWeRX closed 12 years ago
http://svn.php.net/viewvc/pear/packages/DB/trunk/tests/driver/setup.inc?view=markup utilises environment vars if available.
Also http://www.phpunit.de/manual/current/en/database.html#configuration-of-a-phpunit-database-testcase talks about DB configuration via phpunit's .xml
The database is set up and is auth information is stored in the MYSQL_TEST_USER, MYSQL_TEST_PASSWD, MYSQL_TEST_DB and MYSQL_TEST_SOCKET environment variables.
See http://svn.php.net/viewvc/pear/packages/Auth_PrefManager/trunk/tests/setup.php?view=markup for an example of usage.
"Hi Daniel:
On Wed, Nov 16, 2011 at 08:34:04AM +1030, Daniel O'Connor wrote:
I agree and mentioned this on pear-qa a while ago. Take a look at what I committed to DB tests yesterday. It takes advantage of the MYSQLTEST* environment variables, which are used for PHP's tests. We should create a test user and database and set those environment variables in the cron job, or whatever.
A similar setup should be made for PostgreSQL in PEAR and PHP's unit tests. Right now, PHP's tests don't use such environment variables.
SQLite3 tests should use ":memory:" as the database.
Thanks,
--Dan"
...we should (1) do this (2) tweak all DB/MDB2 packages to be configurable/testable in the same way (3) Test with multiple DBs.