https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17944
--- Comment #25 from Jonathan Druart <[email protected]> --- (In reply to Alex Buckley from comment #22) > (in reply to Jonathan Druart in comment 21) > > 1/ What tests specifically do you want? When a subroutine or a method is added or updated, we need to provide tests ("unit tests") in the t directory. For a method like "Koha::ItemType->is_used" you will want to add tests to t/db_dependent/Koha/ItemTypes.t. Create a new subtest per method is a good idea (`git grep subtest t` to see examples) In your case you want to test that this new method returns true if at least 1 item and/or 1 biblioitem is using it. Otherwise it returns false. (In reply to Alex Buckley from comment #24) > (in reply to Jonathan Druart in comment 21) > Could you please explain what you mean in your point 5? Are you asking why I > havent put the is_used subroutine in the Koha::Items and Koha::Biblioitems > files? Instead of using $schema->resultset('Item')->search you can use Koha::Items->search We have Koha objects to represent our data model, so when they exist (Koha::Items and Koha::Biblioitems do exist) it's better to use them. -- 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/
