Bugzilla – Attachment 127512 Details for
Bug 29437
500 error when performing a catalog search for an ISBN13 with no valid ISBN10
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29437: Unit tests
Bug-29437-Unit-tests.patch (text/plain), 2.55 KB, created by
Nick Clemens (kidclamp)
on 2021-11-10 13:47:58 UTC
(
hide
)
Description:
Bug 29437: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-11-10 13:47:58 UTC
Size:
2.55 KB
patch
obsolete
>From 7c9e552049b8716278e692a7873a7d7958a7ad67 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 10 Nov 2021 13:33:41 +0000 >Subject: [PATCH] Bug 29437: Unit tests > >--- > t/db_dependent/Breeding.t | 37 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Breeding.t b/t/db_dependent/Breeding.t >index f3eb54373a..63e86629ce 100755 >--- a/t/db_dependent/Breeding.t >+++ b/t/db_dependent/Breeding.t >@@ -26,10 +26,11 @@ > > use Modern::Perl; > use File::Temp qw/tempfile/; >-use Test::More tests => 5; >+use Test::More tests => 6; > use Test::Warn; > > use t::lib::Mocks qw( mock_preference ); >+use t::lib::TestBuilder; > > use C4::Context; > use C4::Breeding; >@@ -37,6 +38,7 @@ use Koha::Database; > use Koha::XSLT::Base; > > my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; > $schema->storage->txn_begin; > > #Group 1: testing _build_query and _translate_query (part of Z3950Search) >@@ -84,6 +86,39 @@ subtest ImportBreedingAuth => sub { > isnt( $breedingid, $breedingid_2, "For a new record, we get a new id"); > }; > >+subtest BreedingSearch => sub { >+ plan tests => 5; >+ >+ my $import_biblio_1 = $builder->build({ source => 'ImportBiblio', value => { >+ title => 'Unique title the first adventure', >+ author => 'Firstnamey Surnamey', >+ isbn => '1407239961' >+ } >+ }); >+ my $import_biblio_2 = $builder->build({ source => 'ImportBiblio', value => { >+ title => 'Unique title the adventure continues', >+ author => 'Firstnamey Surnamey', >+ isbn => '9798200834976' >+ } >+ }); >+ >+ my ($count, @results) = C4::Breeding::BreedingSearch("Firstnamey Surnamey"); >+ is( $count, 2, "Author search returns two results"); >+ >+ ($count, @results) = C4::Breeding::BreedingSearch("first adventure"); >+ is( $count, 1, "Title search returns one result"); >+ >+ ($count, @results) = C4::Breeding::BreedingSearch("adventure continues"); >+ is( $count, 1, "Title search returns one result"); >+ >+ ($count, @results) = C4::Breeding::BreedingSearch("9781407239965"); >+ is( $count, 1, "ISBN search matches normalized DB value"); >+ >+ ($count, @results) = C4::Breeding::BreedingSearch("9798200834976"); >+ is( $count, 1, "ISBN search for 13 digit ISBN matches 13 digit ISBN in database"); >+ # FIXME - Import doesn't currently store these, but this proves the search works >+}; >+ > $schema->storage->txn_rollback; > > #------------------------------------------------------------------------------- >-- >2.20.1
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 29437
:
127458
|
127460
|
127512
|
127513
|
127516
|
127517
|
127842
|
127843
|
127844
|
127845