News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

CodeUtopia Blog:
Database helper for PHPUnit
August 28, 2008 @ 10:22:12

On the CodeUtopia blog there's a recent post with info on creating a custom event listener in PHPUnit that can help keep you database data completely clean.

When testing code which uses the database, you would usually want to make sure the database stays pristine for each test - All tables should be empty, as any extra data could interfere with the tests. You could probably write an extended Testcase class which automatically does this before each test in setUp and afterwards in tearDown, but it may have some issues. [...] Luckily, PHPUnit has a way to add event listener that react to certain events.

It uses the TestListener interface to make the event handler that (with the help of Doctrine) starts up, makes the tables with data and wipes them out at the end.

Code for the sample listener is in the post and included is the method for checking to see if you even need to use the database or not.

0 comments voice your opinion now!
database phpunit event listener database testlistener



WebDevRadio:
Episode 40 - Listener questions
November 23, 2007 @ 12:20:32

The latest episode of WebDevRadio has been posted (by Michael Kimsal) - some responses to listener questions that have been sent to him.

The latest webdevradio podcast is up. One of the topics is a question for listeners about PHP learning resources; specifically, what are some good resources to learn PHP OO? I also ask about what listeners would recommend to someone just getting in to the webdev field these days - .net, java, ruby, php, something else?

You can either subscribe to their feed to get this (and future episodes) or just get the mp3 only. He also has a web player on the post to listen there as well.

0 comments voice your opinion now!
webdevradio podcast listener questions webdevradio podcast listener questions



Community Events









Don't see your event here?
Let us know!


developer PHP5 database book application framework zend releases conference job package security PEAR mysql ajax cakephp release example zendframework code

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework