Bugzilla – Attachment 62412 Details for
Bug 18459
Add the Koha::Item->biblioitem method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18459: Add the Koha::Item->biblioitem method
Bug-18459-Add-the-KohaItem-biblioitem-method.patch (text/plain), 2.34 KB, created by
Jonathan Druart
on 2017-04-19 18:43:28 UTC
(
hide
)
Description:
Bug 18459: Add the Koha::Item->biblioitem method
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-19 18:43:28 UTC
Size:
2.34 KB
patch
obsolete
>From 1e8ab45916132800236a9a59d2bcd2ca661f47ce Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 19 Apr 2017 17:01:54 +0200 >Subject: [PATCH] Bug 18459: Add the Koha::Item->biblioitem method >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: > prove t/db_dependent/Koha/Items.t > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Item.pm | 14 ++++++++++++++ > t/db_dependent/Koha/Items.t | 12 ++++++++++-- > 2 files changed, 24 insertions(+), 2 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index a921018..44dc2f5 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -92,6 +92,20 @@ sub biblio { > return Koha::Biblio->_new_from_dbic( $biblio_rs ); > } > >+=head3 biblioitem >+ >+my $biblioitem = $item->biblioitem; >+ >+Return the biblioitem record of this item >+ >+=cut >+ >+sub biblioitem { >+ my ( $self ) = @_; >+ my $biblioitem_rs = $self->_result->biblioitem; >+ return Koha::Biblioitem->_new_from_dbic( $biblioitem_rs ); >+} >+ > =head3 get_transfer > > my $transfer = $item->get_transfer; >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index c9d4bac..6452c4e 100644 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 6; >+use Test::More tests => 7; > > use C4::Circulation; > use Koha::Item; >@@ -78,10 +78,18 @@ subtest 'biblio' => sub { > plan tests => 2; > > my $biblio = $retrieved_item_1->biblio; >- is( ref( $biblio ), 'Koha::Biblio', 'Koha::Item->bilio should return a Koha::Biblio' ); >+ is( ref( $biblio ), 'Koha::Biblio', 'Koha::Item->biblio should return a Koha::Biblio' ); > is( $biblio->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblio should return the correct biblio' ); > }; > >+subtest 'biblioitem' => sub { >+ plan tests => 2; >+ >+ my $biblioitem = $retrieved_item_1->biblioitem; >+ is( ref( $biblioitem ), 'Koha::Biblioitem', 'Koha::Item->biblioitem should return a Koha::Biblioitem' ); >+ is( $biblioitem->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblioitem should return the correct biblioitem' ); >+}; >+ > $retrieved_item_1->delete; > is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' ); > >-- >2.9.3
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 18459
:
62387
|
62407
| 62412