[Koha-bugs] [Bug 16868] Silence error t/db_dependent/Linker_FirstMatch.t

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jul 21 01:24:32 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16868

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomascohen at gmail.com
             Status|Needs Signoff               |Failed QA

--- Comment #12 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
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.


More information about the Koha-bugs mailing list