Bugzilla – Attachment 37776 Details for
Bug 13315
Add feedback for last item checked out to circulation.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13315: (QA followup) fix t/db_dependent/Circulation_issue.t
Bug-13315-QA-followup-fix-tdbdependentCirculationi.patch (text/plain), 3.16 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-04-13 18:18:08 UTC
(
hide
)
Description:
Bug 13315: (QA followup) fix t/db_dependent/Circulation_issue.t
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-04-13 18:18:08 UTC
Size:
3.16 KB
patch
obsolete
>From 73c0c9ef0030002f7b9aa31de8b1c5fa3af80da6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Mon, 13 Apr 2015 15:15:29 -0300 >Subject: [PATCH] Bug 13315: (QA followup) fix > t/db_dependent/Circulation_issue.t > >C4::Circulation::AddIssue now returns a Koha::Schema::Result::Issue object >so tests need to be fixed. > >The old behaviour was to always return the due date. It now returns >undef if no issue performed. So one of the tests become irrelevant. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > t/db_dependent/Circulation_issue.t | 30 ++++++++++++++++++++++++------ > 1 file changed, 24 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Circulation_issue.t b/t/db_dependent/Circulation_issue.t >index a37321f..11669c3 100644 >--- a/t/db_dependent/Circulation_issue.t >+++ b/t/db_dependent/Circulation_issue.t >@@ -1,6 +1,22 @@ > #!/usr/bin/perl > >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; >+ > use Koha::DateUtils; > use DateTime::Duration; > use C4::Biblio; >@@ -193,16 +209,19 @@ my $sth = $dbh->prepare($query); > $sth->execute; > my $countissue = $sth -> fetchrow_array; > is ($countissue ,0, "there is no issue"); >-my $datedue1 = C4::Circulation::AddIssue( $borrower_1, 'barcode_1', $daysago10,0, $today, '' ); >+my $issue1 = C4::Circulation::AddIssue( $borrower_1, 'barcode_1', $daysago10,0, $today, '' ); >+is( ref $issue1, 'Koha::Schema::Result::Issue', >+ 'AddIssue returns a Koha::Schema::Result::Issue object' ); >+my $datedue1 = dt_from_string( $issue1->date_due() ); > like( > $datedue1, > qr/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, >- "AddRenewal returns a date" >+ "Koha::Schema::Result::Issue->date_due() returns a date" > ); > my $issue_id1 = $dbh->last_insert_id( undef, undef, 'issues', undef ); > >-my $datedue2 = C4::Circulation::AddIssue( $borrower_1, 'nonexistent_barcode' ); >-is( $datedue2, undef, "AddIssue returns undef if no datedue is specified" ); >+my $issue2 = C4::Circulation::AddIssue( $borrower_1, 'nonexistent_barcode' ); >+is( $issue2, undef, "AddIssue returns undef if no datedue is specified" ); > my $issue_id2 = $dbh->last_insert_id( undef, undef, 'issues', undef ); > > $sth->execute; >@@ -252,8 +271,7 @@ my $openissue = GetOpenIssue($borrower_id1, $item_id1); > > my @renewcount; > #Test GetRenewCount >-$datedue2 = C4::Circulation::AddIssue( $borrower_1, 'barcode_1' ); >-isnt( $datedue2, undef, "AddIssue does not return undef if datedue is specified" ); >+my $issue3 = C4::Circulation::AddIssue( $borrower_1, 'barcode_1' ); > #Without anything in DB > @renewcount = C4::Circulation::GetRenewCount(); > is_deeply( >-- >2.3.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 13315
:
33764
|
33765
|
34250
|
34251
|
34253
|
34254
|
34384
|
34385
|
36290
|
36291
|
36292
| 37776