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

php|architect:
Webcast: Phactory
Mar 23, 2011 @ 14:21:02

On php|architect.com today they've posted the recording of one of their webcast series leading to up the tek11 conference from Chris Kite and Josh Butts about Phactory.

Phactory is an alternative to using database fixtures in your PHP unit tests. Instead of maintaining a separate XML file of data, you define a blueprint for each table and then create as many different objects as you need in your PHP code. By using a database factory instead of fixtures, your unit tests will be more clear and easier to write. You’ll also be able to change the objects you create programmatically instead of being stuck with the same old fixtures.

You can watch the video (with slides for the presentation) either through the in-page player or by downloading the file itself.

tagged: webcast series tek11 phparchitect phactory recording

Link:

Project:
Phactory - A Database Factory for Unit Tests
Aug 12, 2010 @ 13:46:36

Josh Butts pointed out a new tool for those creating unit tests (either in PHPUnit, SimpleTest or any other PHP unit testing framework) that work with databases that replaces fixtures - Phactory.

Phactory is an alternative to using database fixtures in your PHP unit tests. Instead of maintaining a separate XML file of data, you define a blueprint for each table and then create as many different objects as you need in your PHP code. By using a database factory instead of fixtures, your unit tests will be more clear and easier to write. You’ll also be able to change the objects you create programmatically instead of being stuck with the same old fixtures.

The tool gives you a light-weight ORM to use in your tests and, once you define a PDO connection, lets you interact with the objects just like they were normal tables. An example is included on the main page of the site and the code for the project can be found on github.

tagged: unittest phactory database phpunit simpletest

Link:


Trending Topics: