← Back to team overview

anewt-developers team mailing list archive

Re: PostgreSQL testsuite

 

Wouter Bolsterlee wrote:
It looks like the setup and teardown of database connection should be done
in *test suites*, not in unit tests themselves (if I follow the example
mentioned in the PHPUnit documentation). However, at this point I don't know
how to properly create unit test suites (so that you can run *all* tests for
a module at once, or even *all* tests of *all* modules at once), and how to
integrate this into the Anewt codebase. I must admit I haven't closely
looked into this though. Feedback welcome :)

I believe I did this in the PostgreSQL testsuite.
Ideally you want to as much as possible in the testcase setup() method, to keep the tests as isolated as possible, but since connecting to a database is quite slow and it usually doesn't cause much interference between testcases (unless maybe you're checking the connection itself) it's something which may be done in the suite setup() method.

-- Sander



References