Bugzilla – Attachment 21368 Details for
Bug 2720
Overdues which debar automatically should undebar automatically when returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2720: Unit tests improvements
Bug-2720-Unit-tests-improvements.patch (text/plain), 1.98 KB, created by
Kyle M Hall (khall)
on 2013-09-23 12:26:13 UTC
(
hide
)
Description:
Bug 2720: Unit tests improvements
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-09-23 12:26:13 UTC
Size:
1.98 KB
patch
obsolete
>From b825fed119dfcf367f9df54910b87ce18ddfc561 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 18 Jul 2013 12:10:44 +0200 >Subject: [PATCH] Bug 2720: Unit tests improvements > >Create the patron. >Use a transaction. >--- > t/db_dependent/Borrower_Debarments.t | 34 ++++++++++++++-------------------- > 1 files changed, 14 insertions(+), 20 deletions(-) > >diff --git a/t/db_dependent/Borrower_Debarments.t b/t/db_dependent/Borrower_Debarments.t >index 1ee1ebe..88141f6 100755 >--- a/t/db_dependent/Borrower_Debarments.t >+++ b/t/db_dependent/Borrower_Debarments.t >@@ -1,32 +1,24 @@ > #!/usr/bin/perl > >-use strict; >-use warnings; >+use Modern::Perl; > > use C4::Context; > use C4::Members; > > use Test::More tests => 18; > >-BEGIN { >- use FindBin; >- use lib $FindBin::Bin; >- use_ok('Koha::Borrower::Debarments'); >-} >+use_ok('Koha::Borrower::Debarments'); > >-# Get a borrower with no current debarments >-my $dbh = C4::Context->dbh; >-my $query = " >- SELECT b.borrowernumber FROM borrowers b >- LEFT JOIN borrower_debarments bd ON ( b.borrowernumber = bd.borrowernumber ) >- WHERE b.debarred IS NULL AND b.debarredcomment IS NULL AND bd.borrowernumber IS NULL >- LIMIT 1 >-"; >-my $sth = $dbh->prepare($query); >-$sth->execute; >-my ($borrowernumber) = $sth->fetchrow_array(); >-diag("Using borrowernumber: $borrowernumber"); >+my $dbh = C4::Context->dbh; >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; > >+my $borrowernumber = AddMember( >+ firstname => 'my firstname', >+ surname => 'my surname', >+ categorycode => 'S', >+ branchcode => 'CPL', >+); > > my $success = AddDebarment({ > borrowernumber => $borrowernumber, >@@ -99,4 +91,6 @@ foreach my $d ( @$debarments ) { > DelDebarment( $d->{'borrower_debarment_id'} ); > } > $debarments = GetDebarments({ borrowernumber => $borrowernumber }); >-ok( @$debarments == 0, "DelDebarment functions correctly" ) >\ No newline at end of file >+ok( @$debarments == 0, "DelDebarment functions correctly" ); >+ >+$dbh->rollback; >-- >1.7.2.5
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 2720
:
15045
|
15050
|
15051
|
15052
|
16669
|
18213
|
19401
|
19414
|
19418
|
19419
|
19420
|
19421
|
19755
|
20655
|
20656
|
20657
|
20658
|
21366
|
21367
|
21368
|
21369
|
21405
|
21406
|
21407
|
21408
|
21409
|
21410
|
25575
|
25578