http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12603
--- Comment #19 from M. de Rooy <m.de.r...@rijksmuseum.nl> --- General commment: The comment on has_one should not block this patch imo (see comment16). [Removing the belongs_to as in bug 11518 also addresses this problem.] The code, including some less obvious things, contains very little comments (see also the comment of Martin about documentation). The composite foreign keys like in the overduerules_transport_type are handled by a trick: copy the hash from the first composite key to the other one(s). The code in build() looks at the first key of a composite one when searching for values. Using TestBuilder with such a table is not (immediately) clear. (And obviously, code with such trics may not be the easiest to maintain..) I suppose that a table with multiple composite foreign keys sharing the same key could present a problem. I could not find an example in Koha though ;) Passes qa script. I will pass QA on this code, but somewhat hesitant. Note that I do not view TestBuilder as the only way to write a test now in Koha and would not per se recommend refactoring of existing tests. It is just an alternative. Small remarks: +$my_overduerules_transport_type->{categorycode} = $my_overduerules_transport_type->{branchcode}; +my $overduerules_transport_type = $builder->build({ + source => 'OverduerulesTransportType', + value => $my_overduerules_transport_type, +}); o my: my $overdue.. and $my_overdue.. Example of obscure variable naming? + $source =~ s|(\w+)$|$1|; What are you actually changing here? +our $default_value = { + UserPermission => { TestBuilder.t contains the default value for UserPermission. Should not block this patch, but I would rather have it somewhere else. Separate module perhaps? -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org 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/