Thanks for the response! See my follow up below.
On Sun, Oct 25, 2009 at 11:49 AM, Jonathan <jjmon...
> Yeah if dynamic data is what you're testing, I'd lose the XML file.
> But I think you should ask yourself why you would want to test MySQL's
> NOW() function. You didn't write the code, and it's a pretty good bet
> the people at MySQL tested the function thoroughly. All your code
> does is call the function. If you had somehow written a stored
> procedure that extended the functionality of NOW(), I'd test that --
> it's your code, you should prove it works.
Well, what we are using is a function that actually creates the proper
database function based on the type of database(MySQL, Oracle, etc) we
are using. With hopes of becoming database independent in the future,
so there is some functionality I am testing there other then just
MySQL's NOW() function. :-)
> The only situation I see testing being useful is to make sure that
> you've populated the timestamp field at all, in which case you might
> test that the field is not NULL or whatever the default value.
What I actually ended up doing is sticking with the XML file for data
and using phpunit's db extensions filtering capability to ignore the
created and updated fields when using the db extension to compare. You
can get more info here - http://www.digitalsandwich.com/archives/78-Improved-PHPUnit-Filters.html
I then figure out the current time, do a quick query to the database
and pull back the created/updated dates and make sure they happened in
the last 10 secs.