Bugzilla – Attachment 57333 Details for
Bug 17587
Remove itemtype-related IsItemIssued.t warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17587: Remove itemtype-related IsItemIssued.t warnings
Bug-17587-Remove-itemtype-related-IsItemIssuedt-wa.patch (text/plain), 2.22 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-11-08 15:42:43 UTC
(
hide
)
Description:
Bug 17587: Remove itemtype-related IsItemIssued.t warnings
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-11-08 15:42:43 UTC
Size:
2.22 KB
patch
obsolete
>From 965f78692d6ab6d2feb3fbbe7ad314ed318b96bc Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 8 Nov 2016 12:40:45 -0300 >Subject: [PATCH] Bug 17587: Remove itemtype-related IsItemIssued.t warnings > >This patch makes t/db_dependent/Circulation/IsItemIssued.t create >good sample data for its tests. It does so by creating a random >itemtype. > >To test: >- Run > $ prove t/db_dependent/Circulation/IsItemIssued.t >=> FAIL: lots of warnings about "item-level_itypes set but no itemtype >set for item" >- Apply the patch >- Run: > $ prove t/db_dependent/Circulation/IsItemIssued.t >=> SUCCESS: Tests are green, and no warnings. >- Sign off :-D > >Sponsored-by: ByWater Solutions >--- > t/db_dependent/Circulation/IsItemIssued.t | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Circulation/IsItemIssued.t b/t/db_dependent/Circulation/IsItemIssued.t >index 2e1817e..67c9c74 100644 >--- a/t/db_dependent/Circulation/IsItemIssued.t >+++ b/t/db_dependent/Circulation/IsItemIssued.t >@@ -35,9 +35,8 @@ my $schema = Koha::Database->schema; > $schema->storage->txn_begin; > my $builder = t::lib::TestBuilder->new; > >-my $library = $builder->build({ >- source => 'Branch', >-}); >+my $library = $builder->build({ source => 'Branch' }); >+my $itemtype = $builder->build({ source => 'Itemtype' })->{itemtype}; > > my $module = new Test::MockModule('C4::Context'); > $module->mock('userenv', sub { >@@ -53,12 +52,19 @@ my $borrowernumber = AddMember( > branchcode => $library->{branchcode}, > ); > >- > my $borrower = GetMember( borrowernumber => $borrowernumber ); > my $record = MARC::Record->new(); > my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' ); > >-my ( undef, undef, $itemnumber ) = AddItem( { homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, barcode => 'i_dont_exist' }, $biblionumber ); >+my ( undef, undef, $itemnumber ) = AddItem( >+ { homebranch => $library->{branchcode}, >+ holdingbranch => $library->{branchcode}, >+ barcode => 'i_dont_exist', >+ itype => $itemtype >+ }, >+ $biblionumber >+); >+ > my $item = GetItem( $itemnumber ); > > is ( IsItemIssued( $item->{itemnumber} ), 0, "item is not on loan at first" ); >-- >2.7.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 17587
:
57333
|
57367
|
57445