Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mike Lively's Blog:
PHPDBUnit - Testing DB interaction with PHPUnit
Jun 21, 2007 @ 13:56:00

Mike Lively shares some info about a project he's been working on in a new post to his blog today - a port of Java's DBUnit functionality over to PHP to work happily with PHPUnit:

For those of you not familiar with DBUnit, it is a framework that allows you to easily and quickly test php code that modifies and works with database data. [...] With database code this [testing] is somewhat difficult because you have to ensure that your database is in a known state prior to running your tests.

He gives two examples, the first illustrates the difficulty that can come up when trying to test the database information with a normal unit test and the second an example of the same, but using his port of PHPDBUnit to delete information from the database. It uses two XML files in the test - one to seed the database and the other to give the expected export information.

Check out his post for more details on the port from Java and keep an eye out for a beta release of the library as soon as July.

tagged: phpunit unittest phpdbunit java dbunit phpunit unittest phpdbunit java dbunit

Link:

Mike Lively's Blog:
PHPDBUnit - Testing DB interaction with PHPUnit
Jun 21, 2007 @ 13:56:00

Mike Lively shares some info about a project he's been working on in a new post to his blog today - a port of Java's DBUnit functionality over to PHP to work happily with PHPUnit:

For those of you not familiar with DBUnit, it is a framework that allows you to easily and quickly test php code that modifies and works with database data. [...] With database code this [testing] is somewhat difficult because you have to ensure that your database is in a known state prior to running your tests.

He gives two examples, the first illustrates the difficulty that can come up when trying to test the database information with a normal unit test and the second an example of the same, but using his port of PHPDBUnit to delete information from the database. It uses two XML files in the test - one to seed the database and the other to give the expected export information.

Check out his post for more details on the port from Java and keep an eye out for a beta release of the library as soon as July.

tagged: phpunit unittest phpdbunit java dbunit phpunit unittest phpdbunit java dbunit

Link:


Trending Topics: