Bugzilla – Attachment 57603 Details for
Bug 17431
Fix failing test t/db_dependent/api/v1/holds.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17431: Remove use of C4::Items and C4::Biblio
Bug-17431-Remove-use-of-C4Items-and-C4Biblio.patch (text/plain), 1.96 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-11-17 14:29:23 UTC
(
hide
)
Description:
Bug 17431: Remove use of C4::Items and C4::Biblio
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-11-17 14:29:23 UTC
Size:
1.96 KB
patch
obsolete
>From a5eecad287b9a6106b26dae7ba9619b957604a1c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 17 Nov 2016 07:52:38 +0000 >Subject: [PATCH] Bug 17431: Remove use of C4::Items and C4::Biblio > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/holds.t | 38 +++++++++++++++++++------------------- > 1 file changed, 19 insertions(+), 19 deletions(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 8395f52..c7ec7f8 100644 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -24,12 +24,12 @@ use t::lib::TestBuilder; > use DateTime; > > use C4::Context; >-use C4::Biblio; >-use C4::Items; > use C4::Reserves; > > use Koha::Database; >-use Koha::Patron; >+use Koha::Biblios; >+use Koha::Items; >+use Koha::Patrons; > > my $builder = t::lib::TestBuilder->new(); > >@@ -309,25 +309,25 @@ $dbh->rollback; > sub create_biblio { > my ($title) = @_; > >- my $record = new MARC::Record; >- $record->append_fields( >- new MARC::Field('200', ' ', ' ', a => $title), >- ); >- >- my ($biblionumber) = C4::Biblio::AddBiblio($record, ''); >+ my $biblio = Koha::Biblio->new( { title => $title } )->store; > >- return $biblionumber; >+ return $biblio->biblionumber; > } > > sub create_item { >- my ($biblionumber, $barcode) = @_; >- >- my $item = { >- barcode => $barcode, >- }; >- $dbh->do("DELETE FROM items WHERE barcode='$barcode'") if $barcode; >- >- my $itemnumber = C4::Items::AddItem($item, $biblionumber); >+ my ( $biblionumber, $barcode ) = @_; >+ >+ Koha::Items->search( { barcode => $barcode } )->delete; >+ my $builder = t::lib::TestBuilder->new; >+ my $item = $builder->build( >+ { >+ source => 'Item', >+ value => { >+ biblionumber => $biblionumber, >+ barcode => $barcode, >+ } >+ } >+ ); > >- return $itemnumber; >+ return $item->{itemnumber}; > } >-- >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 17431
:
56252
|
56288
|
56655
|
56656
|
56657
|
56658
|
57258
|
57282
|
57283
|
57284
|
57285
|
57584
|
57585
|
57600
|
57601
|
57602
| 57603