http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12603
--- Comment #13 from Yohann Dufour <[email protected]> --- Moreover, the major issue with Test::DBIx::Class::Factory is that you cannot create only the foreign keys for your object. For instance, if I want to test the order in the acquisition module : To create an order, I have to create first : - a basket (which needs a bookseller) - a budget - a biblio With TestBuilder, you can do something like that : my $order = $builder->build({ source => 'Aqorder', only_fk => 1, }) The parameter only_fk allows one to insert in database only the foreign keys : basket, budget and biblio and it returns an hashref to create the order. Then, you can call the NewOrder routine like that : NewOrder($order) With Test::DBIx::Class::Factory, you can do something similar : my $order = $factory->create_record('Aqorder') But it inserts the order in the database, so you cannot test then the NewOrder routine since it is already in the database. Moreover, it returns a DBIx::Class Object which is not compatible with what expects the New or Add routines. Thus, according to me, Test::DBIx::Class::Factory is not compatible with how we test the Koha modules. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
