https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16868
Tomás Cohen Arazi <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Status|Needs Signoff |Failed QA --- Comment #12 from Tomás Cohen Arazi <[email protected]> --- Mark, could you please do something like this instead? (grabbed from some other test and adjusted to your use). sub get_authtority_record { my $main_heading_field = ( C4::Context->preference('MARCFlavour') eq 'UNIMARC' ) ? '200' : '100'; my $auth = MARC::Record->new(); $auth->append_fields( MARC::Field->new($main_heading_field, ' ', ' ', a => 'Geisel, Theodor Seuss,', d => '1904-1991' )); return $auth; } It seems to me that the interpolated XML stuff obfuscates the code, and does unneeded XML processing. Also, the global transaction for tests was discouraged so no need to introduce Database.pm for this simple test as we just do the transaction as it is needed in the tests (think of subtests that do its own rollbacks, etc). So go for the usual: use Koha::Database; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; < tests here > $schema->storage->txn_rollback; BTW, it seems to me that this tests don't bother to launch zebra so they... don't... actually... test anything? Good examples on how to do this can be found (for C&P) on search_utf8.t <- This is not your fault and not really part of your bug report, but worth mentioning. The relevant test, is the last one, and it depends on zebra having the record indexed!! Notice C4::Headings::authorities() is calling _search() which actually triggers a Zebra search. -- 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/
