Bugzilla – Attachment 28962 Details for
Bug 11891
Make Koha::Schema use C4::Context->dbh
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11891: set up tests to require that Koha::Database uses same DB handle as C4::Context
Bug-11891-set-up-tests-to-require-that-KohaDatabas.patch (text/plain), 2.69 KB, created by
Galen Charlton
on 2014-06-18 23:16:53 UTC
(
hide
)
Description:
Bug 11891: set up tests to require that Koha::Database uses same DB handle as C4::Context
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2014-06-18 23:16:53 UTC
Size:
2.69 KB
patch
obsolete
>From bee79008d136c34ba587d1e181b2cd6abe2a0cbc Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Mon, 26 May 2014 18:39:11 +0000 >Subject: [PATCH] Bug 11891: set up tests to require that Koha::Database uses > same DB handle as C4::Context > >This patch removes changes in two cases to work around the fact that >Koha::Database and C4::Context were not using the same DBI database >handle. > >To test: > >[1] Run prove -v t/db_dependent/ILSDI_Services.t and > prove -v t/db_dependent/Items.t. Both tests > should fail. >[2] Apply the main patches and run step 1 again. This > time, both tests should pass. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >--- > t/db_dependent/ILSDI_Services.t | 6 +++--- > t/db_dependent/Items.t | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index 4d584a2..1951ecc 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -22,7 +22,7 @@ $dbh->{RaiseError} = 1; > my %data = ( > firstname => 'my firstname', > surname => 'my surname', >- categorycode => 'PT', >+ categorycode => 'UT', > branchcode => 'UT', > cardnumber => 'ilsdi-cardnumber', > userid => 'ilsdi-userid', >@@ -30,11 +30,11 @@ my %data = ( > ); > > # Crate patron category >-unless ( GetBorrowercategory('PT') ) { >+unless ( GetBorrowercategory('UT') ) { > $dbh->do("INSERT INTO categories > (categorycode,description,enrolmentperiod,upperagelimit,enrolmentfee,overduenoticerequired,reservefee,category_type,default_privacy) > VALUES >- ('PT','Unit tester',99,99,0.000000,1,0.000000,'C','default');"); >+ ('UT','Unit tester',99,99,0.000000,1,0.000000,'C','default');"); > } > > # Create branch >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 6867f83..d1b15fb 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -169,10 +169,10 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > my $biblioitem = $biblio->biblioitem(); > my ( $item ) = $biblioitem->items(); > >- $schema->resultset('Systempreference')->update_or_create({ variable => 'item-level_itypes', value => 0 }); >+ C4::Context->set_preference( 'item-level_itypes', 0 ); > ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); > >- $schema->resultset('Systempreference')->update_or_create({ variable => 'item-level_itypes', value => 1 }); >+ 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 disabled' ); > > >-- >1.7.10.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 11891
:
25828
|
25829
|
28962
|
28963
|
28964
|
28965
|
28966
|
28967
|
28968
|
28969