Bugzilla – Attachment 26264 Details for
Bug 10859
Alert if a patron already has an issue for the same biblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10859: GetIssues.t - Execute unit tests in a transaction
Bug-10859-GetIssuest---Execute-unit-tests-in-a-tra.patch (text/plain), 3.08 KB, created by
Jonathan Druart
on 2014-03-13 12:36:03 UTC
(
hide
)
Description:
Bug 10859: GetIssues.t - Execute unit tests in a transaction
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-13 12:36:03 UTC
Size:
3.08 KB
patch
obsolete
>From 5531ed266200d3f7078aed707ef6b565d317da5d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 13 Mar 2014 12:39:02 +0100 >Subject: [PATCH] Bug 10859: GetIssues.t - Execute unit tests in a transaction > >--- > t/db_dependent/Circulation/GetIssues.t | 36 +++++++++----------------------- > 1 file changed, 10 insertions(+), 26 deletions(-) > >diff --git a/t/db_dependent/Circulation/GetIssues.t b/t/db_dependent/Circulation/GetIssues.t >index 36607d4..e308dbe 100644 >--- a/t/db_dependent/Circulation/GetIssues.t >+++ b/t/db_dependent/Circulation/GetIssues.t >@@ -12,6 +12,10 @@ use C4::Category; > use C4::Circulation; > use MARC::Record; > >+my $dbh = C4::Context->dbh; >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; >+ > my $branchcode; > my $branch_created; > my @branches = keys %{ GetBranches() }; >@@ -58,44 +62,24 @@ AddIssue($borrower, '0203'); > > # Begin tests... > my $issues; >-$issues = GetIssues({biblionumber => $biblionumber1}); >+$issues = C4::Circulation::GetIssues({biblionumber => $biblionumber1}); > is(scalar @$issues, 1, "Biblio $biblionumber1 has 1 item issued"); > is($issues->[0]->{itemnumber}, $itemnumber1, "First item of biblio $biblionumber1 is issued"); > >-$issues = GetIssues({biblionumber => $biblionumber2}); >+$issues = C4::Circulation::GetIssues({biblionumber => $biblionumber2}); > is(scalar @$issues, 1, "Biblio $biblionumber2 has 1 item issued"); > is($issues->[0]->{itemnumber}, $itemnumber3, "First item of biblio $biblionumber2 is issued"); > >-$issues = GetIssues({borrowernumber => $borrowernumber}); >+$issues = C4::Circulation::GetIssues({borrowernumber => $borrowernumber}); > is(scalar @$issues, 2, "Borrower $borrowernumber checked out 2 items"); > >-$issues = GetIssues({borrowernumber => $borrowernumber, biblionumber => $biblionumber1}); >+$issues = C4::Circulation::GetIssues({borrowernumber => $borrowernumber, biblionumber => $biblionumber1}); > is(scalar @$issues, 1, "One of those is an item from biblio $biblionumber1"); > >-$issues = GetIssues({borrowernumber => $borrowernumber, biblionumber => $biblionumber2}); >+$issues = C4::Circulation::GetIssues({borrowernumber => $borrowernumber, biblionumber => $biblionumber2}); > is(scalar @$issues, 1, "The other is an item from biblio $biblionumber2"); > >-$issues = GetIssues({itemnumber => $itemnumber2}); >+$issues = C4::Circulation::GetIssues({itemnumber => $itemnumber2}); > is(scalar @$issues, 0, "No one has issued the second item of biblio $biblionumber2"); > >-END { >- AddReturn('0101', $branchcode); >- AddReturn('0203', $branchcode); >- DelMember($borrowernumber); >- if ($category_created) { >- C4::Context->dbh->do( >- "DELETE FROM categories WHERE categorycode = ?", undef, $categorycode); >- } >- my $dbh = C4::Context->dbh; >- C4::Items::DelItem($dbh, $biblionumber1, $itemnumber1); >- C4::Items::DelItem($dbh, $biblionumber1, $itemnumber2); >- C4::Items::DelItem($dbh, $biblionumber2, $itemnumber3); >- C4::Biblio::DelBiblio($biblionumber1); >- C4::Biblio::DelBiblio($biblionumber2); >- >- if ($branch_created) { >- DelBranch($branchcode); >- } >-}; >- > done_testing; >-- >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 10859
:
20954
|
25362
|
25366
|
26263
|
26264
|
26267
|
26268
|
26269
|
26270