Bugzilla – Attachment 54525 Details for
Bug 14504
Add command-line script to batch delete items based on data in items table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14504 - Changes missed while fixing patches
Bug-14504---Changes-missed-while-fixing-patches.patch (text/plain), 4.03 KB, created by
Kyle M Hall (khall)
on 2016-08-16 16:40:42 UTC
(
hide
)
Description:
Bug 14504 - Changes missed while fixing patches
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-08-16 16:40:42 UTC
Size:
4.03 KB
patch
obsolete
>From 41b05aa5448787b26432946d9ed5ffff9e5da477 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 16 Aug 2016 16:40:46 +0000 >Subject: [PATCH] Bug 14504 - Changes missed while fixing patches > >--- > t/db_dependent/Circulation/IsItemIssued.t | 34 ++++++++++++++++++++------ > t/db_dependent/Items_DelItemCheck.t | 40 ++++++++++++++++++++++++------- > 2 files changed, 58 insertions(+), 16 deletions(-) > >diff --git a/t/db_dependent/Circulation/IsItemIssued.t b/t/db_dependent/Circulation/IsItemIssued.t >index bafc405..2e1817e 100644 >--- a/t/db_dependent/Circulation/IsItemIssued.t >+++ b/t/db_dependent/Circulation/IsItemIssued.t >@@ -1,5 +1,24 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; >+ > use Test::More tests => 5; >+use Test::MockModule; > > use C4::Biblio; > use C4::Circulation; >@@ -12,17 +31,21 @@ use t::lib::TestBuilder; > > use MARC::Record; > >-*C4::Context::userenv = \&Mock_userenv; >- > my $schema = Koha::Database->schema; > $schema->storage->txn_begin; > my $builder = t::lib::TestBuilder->new; >-my $dbh = C4::Context->dbh; > > my $library = $builder->build({ > source => 'Branch', > }); > >+my $module = new Test::MockModule('C4::Context'); >+$module->mock('userenv', sub { >+ { >+ branch => $library->{branchcode} >+ } >+}); >+ > my $borrowernumber = AddMember( > firstname => 'my firstname', > surname => 'my surname', >@@ -60,7 +83,4 @@ is( > > $schema->storage->txn_rollback; > >-# C4::Context->userenv >-sub Mock_userenv { >- return { branch => $library->{branchcode} }; >-} >+1; >diff --git a/t/db_dependent/Items_DelItemCheck.t b/t/db_dependent/Items_DelItemCheck.t >index abe6600..20b3b11 100644 >--- a/t/db_dependent/Items_DelItemCheck.t >+++ b/t/db_dependent/Items_DelItemCheck.t >@@ -1,21 +1,39 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; > > use C4::Circulation; >+use Koha::Database; > > use t::lib::TestBuilder; > use t::lib::Mocks; > > use Test::More tests => 9; >- >-*C4::Context::userenv = \&Mock_userenv; >+use Test::MockModule; > > BEGIN { > use_ok('C4::Items'); > } > >-my $dbh = C4::Context->dbh; >- > my $builder = t::lib::TestBuilder->new(); >+my $schema = Koha::Database->new->schema; >+# Begin transaction >+$schema->storage->txn_begin; > > my $branch = $builder->build( > { >@@ -23,6 +41,13 @@ my $branch = $builder->build( > } > ); > >+my $module = new Test::MockModule('C4::Context'); >+$module->mock('userenv', sub { >+ { flags => 0, >+ branch => $branch->{branchcode} >+ } >+}); >+ > my $branch2 = $builder->build( > { > source => 'Branch', >@@ -140,9 +165,6 @@ is( $test_item->{itemnumber}, undef, > "DelItemCheck should delete item if ItemSafeToDelete returns true" > ); > >-# End of testing >+$schema->storage->txn_rollback; > >-# C4::Context->userenv >-sub Mock_userenv { >- return { flags => 0, branch => $branch->{branchcode} }; >-} >+1; >-- >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 14504
:
40830
|
42978
|
43445
|
43533
|
43788
|
43789
|
44013
|
44149
|
45789
|
49648
|
49649
|
49650
|
49651
|
49652
|
49653
|
52425
|
53224
|
53225
|
54514
|
54515
|
54516
|
54517
|
54518
|
54519
|
54520
|
54521
|
54522
|
54525
|
54530
|
54531
|
54691
|
54692
|
54693
|
54694
|
54695
|
54696
|
54697
|
54698
|
54699
|
54700
|
54701
|
54702
|
54703