[dev] [Fwd: [cvs] commit: kronolith/lib api.php mnemo/lib api.php nag/lib api.php turba/lib api.php]

Chuck Hagenbuch chuck at horde.org
Mon May 1 14:13:27 PDT 2006


Quoting Karsten Fourmont <fourmont at gmx.de>:

> The answer to this is obviously unit testing.

Obviously :)

> So I wrote a small script to do this. It currently tests
>
> list, listBy, getActionTimestamp, import, export, replace, and delete
>
> of kronolith, mnemo, nag, and turba.
>
> The current state of the script is attached. It's designed to run be
> located in horde/scripts. It automatically creates a user "testuser"
> with random password. All data of testuser is deleted, so be careful.
>
> Any suggestions? Shall I commit it like this or convert it to .phpt. In
> which directory shall I put it?

I'd prefer to see it split into individual scripts for each  
application. A tests/ folder under each app, a general helper file,  
and .phpt tests for each method are ideal in my opinion.  
Alternatively, I like PHPUnit a lot for unit testing, and you can do  
one function per test that way, plus the test harness.

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list