Bugzilla – Attachment 57367 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]
[SIGNED-OFF] Bug 17587: Remove itemtype-related IsItemIssued.t warnings
SIGNED-OFF-Bug-17587-Remove-itemtype-related-IsIte.patch (text/plain), 2.29 KB, created by
Josef Moravec
on 2016-11-09 10:12:17 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17587: Remove itemtype-related IsItemIssued.t warnings
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-11-09 10:12:17 UTC
Size:
2.29 KB
patch
obsolete
>From e41bbed7c402b2c88cc50975fad7b23b8f6c45fc 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] [SIGNED-OFF] 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 > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > 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.1.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