Bug 35989: (QA follow-up): Fix QA tests

Some file tidying to pass the QA tests

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 361ec4b2ea)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Matt Blenkinsop 2024-05-30 08:22:08 +00:00 committed by Lucas Gass
parent 4ca639a5f6
commit eff4e19ef8
2 changed files with 40 additions and 36 deletions

View File

@ -1009,9 +1009,9 @@ sub BuildSummary {
} } $record->field('7..'); } } $record->field('7..');
} else { } else {
# construct MARC21 summary # construct MARC21 summary
# FIXME - looping over 1XX is questionable # FIXME - looping over 1XX is questionable
# since MARC21 authority should have only one 1XX # since MARC21 authority should have only one 1XX
use C4::Heading::MARC21; use C4::Heading::MARC21;
my $handler = C4::Heading::MARC21->new(); my $handler = C4::Heading::MARC21->new();
my $subfields_to_report; my $subfields_to_report;

View File

@ -29,44 +29,48 @@ $module->mock('GetHeaderAuthority', sub {
$module->mock('AddAuthorityTrees', sub { $module->mock('AddAuthorityTrees', sub {
return; return;
}); });
$module->mock('GetAuthority', sub { $module->mock(
my ($authid) = @_; 'GetAuthority',
my $record = MARC::Record->new(); sub {
if ($authid eq '1') { my ($authid) = @_;
$record->add_fields( my $record = MARC::Record->new();
[ '001', '1' ], if ( $authid eq '1' ) {
[ '151', ' ', ' ', a => 'United States' ] $record->add_fields(
[ '001', '1' ],
[ '151', ' ', ' ', a => 'United States' ]
); );
} elsif ($authid eq '2') { } elsif ( $authid eq '2' ) {
$record->add_fields( $record->add_fields(
[ '001', '2' ], [ '001', '2' ],
[ '151', ' ', ' ', a => 'New York (State)' ], [ '151', ' ', ' ', a => 'New York (State)' ],
[ '551', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ], [ '551', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ],
[ '751', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ], [ '751', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ],
[ '781', ' ', ' ', a => 'New York', x => 'General subdivision', 9 => '1' ] [ '781', ' ', ' ', a => 'New York', x => 'General subdivision', 9 => '1' ]
);
} elsif ($authid eq '3') {
$record->add_fields(
[ '001', '3' ],
[ '151', ' ', ' ', a => 'New York (City)' ],
[ '551', ' ', ' ', a => 'New York (State)', w => 'g', 9 => '2' ]
); );
} elsif ($authid eq '4') { } elsif ( $authid eq '3' ) {
$record->add_fields( $record->add_fields(
[ '001', '4' ], [ '001', '3' ],
[ '151', ' ', ' ', a => 'New York (City)' ], [ '151', ' ', ' ', a => 'New York (City)' ],
[ '551', ' ', ' ', a => 'New York (State)', w => 'g' ] [ '551', ' ', ' ', a => 'New York (State)', w => 'g', 9 => '2' ]
); );
} elsif ($authid eq '5') { } elsif ( $authid eq '4' ) {
$record->add_fields( $record->add_fields(
[ '001', '5' ], [ '001', '4' ],
[ '100', ' ', ' ', a => 'Lastname, Firstname', b => 'b', c => 'c', i => 'i' ] [ '151', ' ', ' ', a => 'New York (City)' ],
[ '551', ' ', ' ', a => 'New York (State)', w => 'g' ]
); );
} else { } elsif ( $authid eq '5' ) {
undef $record; $record->add_fields(
[ '001', '5' ],
[ '100', ' ', ' ', a => 'Lastname, Firstname', b => 'b', c => 'c', i => 'i' ]
);
} else {
undef $record;
}
return $record;
} }
return $record; );
});
my $schema = Koha::Database->new->schema; my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin; $schema->storage->txn_begin;