Bugzilla – Attachment 92544 Details for
Bug 23413
Add a holds routine to Koha::Items to fetch related holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23413: Update tests to use build_sample_biblio
Bug-23413-Update-tests-to-use-buildsamplebiblio.patch (text/plain), 3.08 KB, created by
Nick Clemens (kidclamp)
on 2019-09-03 11:27:00 UTC
(
hide
)
Description:
Bug 23413: Update tests to use build_sample_biblio
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-09-03 11:27:00 UTC
Size:
3.08 KB
patch
obsolete
>From 386bb70fdd4bf9a577dad92051dcab15210f5408 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 3 Sep 2019 11:20:24 +0000 >Subject: [PATCH] Bug 23413: Update tests to use build_sample_biblio > >Before these changes the tests fail if run under Elasticsearch > >This makes sure they pass either way >--- > t/db_dependent/Koha/Items.t | 41 ++++++++++++++++------------------------- > 1 file changed, 16 insertions(+), 25 deletions(-) > >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 6c1bedc1f9..0d601b1e19 100644 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -35,27 +35,20 @@ my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; >-my $biblioitem = $builder->build( { source => 'Biblioitem' } ); > my $library = $builder->build( { source => 'Branch' } ); > my $nb_of_items = Koha::Items->search->count; >-my $new_item_1 = Koha::Item->new( >- { biblionumber => $biblioitem->{biblionumber}, >- biblioitemnumber => $biblioitem->{biblioitemnumber}, >- homebranch => $library->{branchcode}, >- holdingbranch => $library->{branchcode}, >- barcode => "a_barcode_for_t", >- itype => 'BK', >- } >-)->store; >-my $new_item_2 = Koha::Item->new( >- { biblionumber => $biblioitem->{biblionumber}, >- biblioitemnumber => $biblioitem->{biblioitemnumber}, >- homebranch => $library->{branchcode}, >- holdingbranch => $library->{branchcode}, >- barcode => "another_bc_for_t", >- itype => 'BK', >- } >-)->store; >+my $biblio = $builder->build_sample_biblio(); >+my $new_item_1 = $builder->build_sample_item({ >+ biblionumber => $biblio->biblionumber, >+ homebranch => $library->{branchcode}, >+ holdingbranch => $library->{branchcode}, >+}); >+my $new_item_2 = $builder->build_sample_item({ >+ biblionumber => $biblio->biblionumber, >+ homebranch => $library->{branchcode}, >+ holdingbranch => $library->{branchcode}, >+}); >+ > > t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} }); > >@@ -145,16 +138,14 @@ subtest 'can_be_transferred' => sub { > t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1); > t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype'); > >+ my $biblio = $builder->build_sample_biblio(); > my $library1 = $builder->build_object( { class => 'Koha::Libraries' } ); > my $library2 = $builder->build_object( { class => 'Koha::Libraries' } ); >- my $item = Koha::Item->new({ >- biblionumber => $biblioitem->{biblionumber}, >- biblioitemnumber => $biblioitem->{biblioitemnumber}, >+ my $item = $builder->build_sample_item({ >+ biblionumber => $biblio->biblionumber, > homebranch => $library1->branchcode, > holdingbranch => $library1->branchcode, >- itype => 'test', >- barcode => "newbarcode", >- })->store; >+ }); > $nb_of_items++; > > is(Koha::Item::Transfer::Limits->search({ >-- >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 23413
:
91912
|
92123
|
92128
|
92129
|
92542
|
92543
| 92544 |
94686
|
94722