Bugzilla – Attachment 70949 Details for
Bug 14769
Authorities merge: Set correct indicators in biblio field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14769: Add unit tests for Koha::Authority::BiblioIndicators
Bug-14769-Add-unit-tests-for-KohaAuthorityBiblioIn.patch (text/plain), 1.95 KB, created by
Marcel de Rooy
on 2018-01-26 11:17:30 UTC
(
hide
)
Description:
Bug 14769: Add unit tests for Koha::Authority::BiblioIndicators
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-01-26 11:17:30 UTC
Size:
1.95 KB
patch
obsolete
>From d8fdf067ec1125922a6170f36cdc68a7af52ea15 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 26 Jan 2018 12:12:18 +0100 >Subject: [PATCH] Bug 14769: Add unit tests for > Koha::Authority::BiblioIndicators >Content-Type: text/plain; charset=utf-8 > >--- > t/db_dependent/Authority/BiblioIndicators.t | 46 +++++++++++++++++++++++++++++ > 1 file changed, 46 insertions(+) > create mode 100644 t/db_dependent/Authority/BiblioIndicators.t > >diff --git a/t/db_dependent/Authority/BiblioIndicators.t b/t/db_dependent/Authority/BiblioIndicators.t >new file mode 100644 >index 0000000..5a34da6 >--- /dev/null >+++ b/t/db_dependent/Authority/BiblioIndicators.t >@@ -0,0 +1,46 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use Data::Dumper qw/Dumper/; >+use MARC::Record; >+use MARC::Field; >+use Test::More tests => 1; >+ >+use Koha::Authority::BiblioIndicators; >+use Koha::Database; >+ >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; >+ >+subtest "Trivial tests" => sub { >+ plan tests => 6; >+ >+ my $oInd = Koha::Authority::BiblioIndicators->new; >+ is_deeply( $oInd->get({}), {}, 'Empty hash for no parameters' ); >+ my $record = MARC::Record->new; >+ $record->append_fields( >+ MARC::Field->new( '100', '3', '3', a => 'My name' ), >+ ); >+ my $res = $oInd->get({ >+ flavour => "MARC21", >+ report_tag => '100', >+ auth_record => $record, >+ biblio_tag => '100', >+ }); >+ is( $res->{ind1}, '3', 'Check first indicator' ); >+ is( exists $res->{ind2}, 1, 'Check existence of indicator2 key' ); >+ is( $res->{ind2}, undef, 'Check second indicator value' ); >+ >+ $res = $oInd->get({ >+ flavour => "MARC21", >+ report_tag => '100', >+ auth_record => $record, >+ biblio_tag => '700', >+ }); >+ is( $res->{ind1}, '3', 'Check first indicator' ); >+ is( exists $res->{ind2}, '', 'Check if indicator2 key does not exist' ); >+ >+ $oInd->clear; >+}; >+ >+$schema->storage->txn_rollback; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14769
:
42197
|
69343
|
70948
|
70949
|
70950
|
70951
|
71338
|
71339
|
71340
|
71341
|
71342
|
71343
|
71351
|
71352
|
71353
|
71354
|
71355
|
71366
|
71374
|
71375
|
71376
|
71377
|
71378
|
71379
|
71380
|
71381
|
72398
|
72399
|
72400
|
72401
|
72402
|
72403
|
72404
|
73389
|
73773
|
73774
|
73775
|
73776
|
73777
|
73778
|
73779
|
74052