Bugzilla – Attachment 65007 Details for
Bug 16825
Add API route for getting an item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16825: (squashable) Fix test cleanup issues
Bug-16825-squashable-Fix-test-cleanup-issues.patch (text/plain), 1.61 KB, created by
Lari Taskula
on 2017-07-12 12:10:57 UTC
(
hide
)
Description:
Bug 16825: (squashable) Fix test cleanup issues
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2017-07-12 12:10:57 UTC
Size:
1.61 KB
patch
obsolete
>From 0ce284e946bdb0358e6fa33f1b7ecb158e6ad4a5 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Wed, 12 Jul 2017 15:09:18 +0300 >Subject: [PATCH] Bug 16825: (squashable) Fix test cleanup issues > >Roll back failed at the end of the test. Apply this patch to fix the issue. > >To test: >1. prove t/db_dependent/api/v1/items.t >2. Check your database to make sure nothing persists after the test >--- > t/db_dependent/api/v1/items.t | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/api/v1/items.t b/t/db_dependent/api/v1/items.t >index 0b97313..9b3d2e6 100644 >--- a/t/db_dependent/api/v1/items.t >+++ b/t/db_dependent/api/v1/items.t >@@ -21,6 +21,7 @@ use Modern::Perl; > > use Test::More tests => 12; > use Test::Mojo; >+use t::lib::Mocks; > use t::lib::TestBuilder; > > use C4::Auth; >@@ -32,11 +33,14 @@ use Koha::Database; > use Koha::Patron; > use Koha::Items; > >+my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new(); > >-my $dbh = C4::Context->dbh; >-$dbh->{AutoCommit} = 0; >-$dbh->{RaiseError} = 1; >+# FIXME: sessionStorage defaults to mysql, but it seems to break transaction handling >+# this affects the other REST api tests >+t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); >+ >+$schema->storage->txn_begin; > > $ENV{REMOTE_ADDR} = '127.0.0.1'; > my $t = Test::Mojo->new('Koha::REST::V1'); >@@ -99,7 +103,7 @@ $t->request_ok($tx) > ->json_is('/biblionumber' => $biblionumber) > ->json_is('/itemnotes_nonpublic' => $item->{itemnotes_nonpublic}); > >-$dbh->rollback; >+$schema->storage->txn_rollback; > > sub create_session { > my (@borrowers) = @_; >-- >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 16825
:
52943
|
52947
|
53035
|
53108
|
53111
|
53222
|
53837
|
53921
|
53923
|
54052
|
54686
|
54687
|
56122
|
56123
|
56124
|
56125
|
56131
|
56133
|
56290
|
56292
|
56293
|
61176
|
64275
|
65007
|
67865
|
91051
|
91061
|
91124
|
91399
|
91401
|
92639