Bugzilla – Attachment 96497 Details for
Bug 24267
C4::Breeding::ImportBreedingAuth is ineffective
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24267: Unit tests
Bug-24267-Unit-tests.patch (text/plain), 2.16 KB, created by
Nick Clemens (kidclamp)
on 2019-12-19 17:44:06 UTC
(
hide
)
Description:
Bug 24267: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-12-19 17:44:06 UTC
Size:
2.16 KB
patch
obsolete
>From a1a6967f24b2f36ba4aea8ceaf0a7ae7da62a375 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 19 Dec 2019 17:37:23 +0000 >Subject: [PATCH] Bug 24267: Unit tests > >--- > t/db_dependent/Breeding.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Breeding.t b/t/db_dependent/Breeding.t >index 0aad4e4d02..1e3f9a3832 100755 >--- a/t/db_dependent/Breeding.t >+++ b/t/db_dependent/Breeding.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > > use FindBin; >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::Warn; > use t::lib::Mocks qw( mock_preference ); > >@@ -57,6 +57,30 @@ subtest '_add_rowdata' => sub { > test_add_rowdata(); > }; > >+subtest ImportBreedingAuth => sub { >+ plan tests => 4; >+ >+ my $record = MARC::Record->new(); >+ $record->append_fields( >+ MARC::Field->new('001', '4815162342'), >+ MARC::Field->new('100', ' ', ' ', a => 'Jansson, Tove'), >+ ); >+ >+ my $breedingid = C4::Breeding::ImportBreedingAuth($record,"kidclamp","UTF8"); >+ ok( $breedingid, "We got a breeding id back"); >+ my $breedingid_1 = C4::Breeding::ImportBreedingAuth($record,"kidclamp","UTF8"); >+ is( $breedingid, $breedingid_1, "For the same record, we get the same id"); >+ $breedingid_1 = C4::Breeding::ImportBreedingAuth($record,"marcelr","UTF8"); >+ is( $breedingid, $breedingid_1, "For the same record in a different file, we get a new id"); >+ my $record_1 = MARC::Record->new(); >+ $record_1->append_fields( >+ MARC::Field->new('001', '8675309'), >+ MARC::Field->new('100', ' ', ' ', a => 'Cooper, Susan'), >+ ); >+ my $breedingid_2 = C4::Breeding::ImportBreedingAuth($record_1,"kidclamp","UTF8"); >+ isnt( $breedingid, $breedingid_2, "For a new record, we get a new id"); >+}; >+ > #------------------------------------------------------------------------------- > > sub test_build_translate_query { >@@ -237,3 +261,4 @@ sub test_add_rowdata { > # Test repeatble tags,the trailing whitespace is a normal side-effect of _add_custom_row_data > is_deeply(\$returned_row->{"035\$a"}, \["First 035 ", "Second 035 "],"_add_rowdata supports repeatable tags"); > } >+ >-- >2.11.0
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 24267
:
96453
|
96482
|
96496
|
96497
|
96502
|
96503
|
96504
|
96741
|
96742
|
96743