[Koha-devel] Unit tests and mock module

Colin Campbell colin.campbell at ptfs-europe.com
Fri Sep 7 15:36:18 CEST 2012


On Fri, Sep 07, 2012 at 02:41:18PM +0200, Paul Poulain wrote:
> Hi Koha-devel,
> 
> I just pushed t/Members_AttributeTypes.t unit tests that fake the
> database. The test here could be redundant with t/db_dependent tests
> 
> I feel we should be aware of that, and :
>  * decide Mock is the way to go, and promote using of Mock, removing
> db_dependent tests (that fail if you don't have a database)
Mocking the tests allows for more focused testing. The problem with the
db_dependent tests is that so many variables get added to the mix.
I think that we should recommend using Mock but due to the horrible
jungle of dependencies in much of our code some things force us to use a
db_dependent test
C.

-- 
Colin Campbell
Chief Software Engineer,
PTFS Europe Limited
Content Management and Library Solutions
+44 (0) 800 756 6803 (phone)
+44 (0) 7759 633626  (mobile)
colin.campbell at ptfs-europe.com
skype: colin_campbell2

http://www.ptfs-europe.com


More information about the Koha-devel mailing list