Bugzilla – Attachment 133871 Details for
Bug 28269
Order search should be possible with ISSN too
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28269: Add tests for Acquisitions Orders search by ISSN also with SearchWithISSNVariations on and off
Bug-28269-Add-tests-for-Acquisitions-Orders-search.patch (text/plain), 3.60 KB, created by
Slava Shishkin
on 2022-04-26 09:57:04 UTC
(
hide
)
Description:
Bug 28269: Add tests for Acquisitions Orders search by ISSN also with SearchWithISSNVariations on and off
Filename:
MIME Type:
Creator:
Slava Shishkin
Created:
2022-04-26 09:57:04 UTC
Size:
3.60 KB
patch
obsolete
>From 512e627043a67a87655dd5947bcc7c495d7210f1 Mon Sep 17 00:00:00 2001 >From: Slava Shishkin <slavashishkin@gmail.com> >Date: Mon, 25 Apr 2022 15:16:48 +0300 >Subject: [PATCH] Bug 28269: Add tests for Acquisitions Orders search by ISSN > also with SearchWithISSNVariations on and off > >--- > t/db_dependent/Acquisition.t | 54 ++++++++++++++++++++++++++++++++---- > 1 file changed, 48 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t >index ae8855d7b7..fe499440d4 100755 >--- a/t/db_dependent/Acquisition.t >+++ b/t/db_dependent/Acquisition.t >@@ -475,10 +475,6 @@ is( scalar( @$orders ), 1, 'GetHistory returns correctly a search for internalno > $orders = GetHistory( vendornote => 'vendor note foo' ); > is( scalar( @$orders ), 1, 'GetHistory returns correctly a search for vendornote' ); > >- >-# Test GetHistory() with and without SearchWithISBNVariations >-# The ISBN passed as a param is the ISBN-10 version of the 13-digit ISBN in the sample record declared in $marcxml >- > my $budgetid2 = C4::Budgets::AddBudget( > { > budget_code => "budget_code_test_modrecv", >@@ -616,16 +612,53 @@ sub run_flavoured_tests { > is( scalar(@$orders), 1, "GetHistory searches correctly by ISBN" ); > > Koha::Acquisition::Orders->find($ordernumber)->cancel; >+ >+ my $marc_record_issn = MARC::Record->new; >+ $marc_record_issn->append_fields( create_issn_field( '2434561X', $marcflavour ) ); >+ my ( $biblionumber6_issn, undef ) = AddBiblio( $marc_record_issn, '' ); >+ >+ my $orders_issn = GetHistory( issn => '2434561X' ); >+ is( scalar(@$orders_issn), 0, "Precheck that ISSN shouln't be in database" ); >+ >+ # Create order >+ my $ordernumber_issn = Koha::Acquisition::Order->new( { >+ basketno => $basketno, >+ biblionumber => $biblionumber6_issn, >+ budget_id => $budget->{budget_id}, >+ order_internalnote => "internal note", >+ order_vendornote => "vendor note", >+ quantity => 1, >+ ecost => 10, >+ rrp => 10, >+ listprice => 10, >+ ecost => 10, >+ rrp => 10, >+ discount => 0, >+ uncertainprice => 0, >+ } )->store->ordernumber; >+ >+ t::lib::Mocks::mock_preference('SearchWithISSNVariations', 0); >+ $orders_issn = GetHistory( issn => '2434-561X' ); >+ is( scalar(@$orders_issn), 0, "GetHistory searches correctly by ISSN" ); >+ >+ t::lib::Mocks::mock_preference('SearchWithISSNVariations', 1); >+ $orders_issn = GetHistory( issn => '2434-561X' ); >+ is( scalar(@$orders_issn), 1, "GetHistory searches correctly by ISSN" ); >+ >+ Koha::Acquisition::Orders->find($ordernumber_issn)->cancel; > } > >+# Test GetHistory() with and without SearchWithISBNVariations or SearchWithISSNVariations >+# The ISBN passed as a param is the ISBN-10 version of the 13-digit ISBN in the sample record declared in $marcxml >+ > # Do "flavoured" tests > subtest 'MARC21' => sub { >- plan tests => 2; >+ plan tests => 5; > run_flavoured_tests('MARC21'); > }; > > subtest 'UNIMARC' => sub { >- plan tests => 2; >+ plan tests => 5; > run_flavoured_tests('UNIMARC'); > }; > >@@ -663,6 +696,15 @@ sub create_isbn_field { > return $field; > } > >+sub create_issn_field { >+ my ( $issn, $marcflavour ) = @_; >+ >+ my ( $issn_field, $issn_subfield ) = get_issn_field(); >+ my $field = MARC::Field->new( $issn_field, '', '', $issn_subfield => $issn ); >+ >+ return $field; >+} >+ > subtest 'ModReceiveOrder replacementprice tests' => sub { > plan tests => 2; > #Let's build an order, we need a couple things though >-- >2.35.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 28269
:
133782
|
133796
|
133869
|
133870
|
133871
|
134386
|
134387
|
134427
|
134428
|
138185
|
138186
|
138850
|
138851
|
138852