Bugzilla – Attachment 42425 Details for
Bug 11213
GetItemsInfo() called twice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11213: Fix mixing Koha::Database and C4::Context->dbh in test
Bug-11213-Fix-mixing-KohaDatabase-and-C4Context-db.patch (text/plain), 2.79 KB, created by
Srdjan Jankovic
on 2015-09-07 06:15:57 UTC
(
hide
)
Description:
Bug 11213: Fix mixing Koha::Database and C4::Context->dbh in test
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2015-09-07 06:15:57 UTC
Size:
2.79 KB
patch
obsolete
>From 79b8beb19a628450deec890fba1dbd4cb015ab86 Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >Date: Mon, 7 Sep 2015 18:13:05 +1200 >Subject: [PATCH] Bug 11213: Fix mixing Koha::Database and C4::Context->dbh in > test > >--- > t/db_dependent/Items.t | 21 ++++++--------------- > 1 file changed, 6 insertions(+), 15 deletions(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 5fed5a3..d621f62 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -32,6 +32,7 @@ BEGIN { > } > > my $dbh = C4::Context->dbh; >+$dbh->{RaiseError} = 1; > my $branches = GetBranches; > my ($branch1, $branch2) = keys %$branches; > >@@ -40,8 +41,7 @@ subtest 'General Add, Get and Del tests' => sub { > plan tests => 10; > > # Start transaction >- $dbh->{AutoCommit} = 0; >- $dbh->{RaiseError} = 1; >+ local $dbh->{AutoCommit} = 0; > > # Create a biblio instance for testing > C4::Context->set_preference('marcflavour', 'MARC21'); >@@ -92,8 +92,7 @@ subtest 'GetHiddenItemnumbers tests' => sub { > # This sub is controlled by the OpacHiddenItems system preference. > > # Start transaction >- $dbh->{AutoCommit} = 0; >- $dbh->{RaiseError} = 1; >+ local $dbh->{AutoCommit} = 0; > > # Create a new biblio > C4::Context->set_preference('marcflavour', 'MARC21'); >@@ -177,8 +176,7 @@ subtest 'GetItemsInfo tests' => sub { > plan tests => 4; > > # Start transaction >- $dbh->{AutoCommit} = 0; >- $dbh->{RaiseError} = 1; >+ local $dbh->{AutoCommit} = 0; > > # Add a biblio > my ($biblionumber, $biblioitemnumber) = get_biblio(); >@@ -213,11 +211,8 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > > plan tests => 2; > >- # Start transaction >- $dbh->{AutoCommit} = 0; >- $dbh->{RaiseError} = 1; >- > my $schema = Koha::Database->new()->schema(); >+ $schema->txn_begin; > > my $biblio = > $schema->resultset('Biblio')->create( >@@ -240,16 +235,13 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > > C4::Context->set_preference( 'item-level_itypes', 1 ); > ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' ); >- >- $dbh->rollback; > }; > > subtest 'SearchItems test' => sub { > plan tests => 14; > > # Start transaction >- $dbh->{AutoCommit} = 0; >- $dbh->{RaiseError} = 1; >+ local $dbh->{AutoCommit} = 0; > > C4::Context->set_preference('marcflavour', 'MARC21'); > my ($biblionumber) = get_biblio(); >@@ -413,7 +405,6 @@ subtest 'Koha::Item(s) tests' => sub { > # Start transaction > my $schema = Koha::Database->new()->schema(); > $schema->storage->txn_begin(); >- $dbh->{RaiseError} = 1; > > # Create a biblio and item for testing > C4::Context->set_preference('marcflavour', 'MARC21'); >-- >1.9.1
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 11213
:
22800
|
26394
|
26430
|
26431
|
26499
|
26500
|
26695
|
26696
|
26713
|
26718
|
26719
|
26720
|
26721
|
29557
|
29558
|
29559
|
29560
|
29561
|
29562
|
29563
|
29564
|
38584
|
38585
|
38586
|
38587
|
38588
|
38589
|
38590
|
39023
|
39024
|
39025
|
39026
|
39027
|
39028
|
39029
|
42234
|
42235
|
42236
|
42237
|
42238
|
42239
|
42240
|
42425
|
49750
|
49751
|
49752
|
49753
|
49754
|
49755
|
50163
|
50164
|
50165
|
50166
|
50167
|
50168
|
54447
|
54448
|
54449
|
54450
|
54451
|
54452
|
57578
|
57579
|
57580
|
57581
|
57582
|
57583
|
62434
|
62435
|
62436
|
62437
|
62438
|
62439
|
68646
|
68818
|
68819
|
68820
|
68821
|
68822
|
68823