Bugzilla – Attachment 83216 Details for
Bug 21999
C4::Circulation::AddIssue uses DBIx::Class directly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21999: Update Tests to reflect new return value of AddIssue
Bug-21999-Update-Tests-to-reflect-new-return-value.patch (text/plain), 5.37 KB, created by
Martin Renvoize (ashimema)
on 2018-12-14 15:07:36 UTC
(
hide
)
Description:
Bug 21999: Update Tests to reflect new return value of AddIssue
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-12-14 15:07:36 UTC
Size:
5.37 KB
patch
obsolete
>From 1d7fc02aa9eb6eaec4fac3f222bac405e4eac88e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 14 Dec 2018 15:03:46 +0000 >Subject: [PATCH] Bug 21999: Update Tests to reflect new return value of > AddIssue > >--- > t/db_dependent/Circulation.t | 4 ++-- > t/db_dependent/Circulation/issue.t | 6 +++--- > t/db_dependent/Letters/TemplateToolkit.t | 14 +++++++------- > 3 files changed, 12 insertions(+), 12 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 02b45c366a..42783ea401 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -1233,7 +1233,7 @@ subtest 'CanBookBeIssued & AllowReturnToBranch' => sub { > set_userenv($holdingbranch); > > my $issue = AddIssue( $patron_1->unblessed, $item->{barcode} ); >- is( ref($issue), 'Koha::Schema::Result::Issue' ); # FIXME Should be Koha::Checkout >+ is( ref($issue), 'Koha::Checkout' ); # FIXME Should be Koha::Checkout > > my ( $error, $question, $alerts ); > >@@ -1326,7 +1326,7 @@ subtest 'AddIssue & AllowReturnToBranch' => sub { > > set_userenv($holdingbranch); > >- my $ref_issue = 'Koha::Schema::Result::Issue'; # FIXME Should be Koha::Checkout >+ my $ref_issue = 'Koha::Checkout'; # FIXME Should be Koha::Checkout > my $issue = AddIssue( $patron_1, $item->{barcode} ); > > my ( $error, $question, $alerts ); >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index f613f081f1..b0a190cc41 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -183,13 +183,13 @@ $sth->execute; > my $countissue = $sth -> fetchrow_array; > is ($countissue ,0, "there is no issue"); > 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' ); >+is( ref $issue1, 'Koha::Checkout', >+ 'AddIssue returns a Koha::Checkout 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}/, >- "Koha::Schema::Result::Issue->date_due() returns a date" >+ "Koha::Checkout->date_due() returns a date" > ); > my $issue_id1 = $issue1->issue_id; > >diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t >index 2714317458..e2c3f31095 100644 >--- a/t/db_dependent/Letters/TemplateToolkit.t >+++ b/t/db_dependent/Letters/TemplateToolkit.t >@@ -653,11 +653,11 @@ EOF > reset_template( { template => $template, code => $code, module => 'circulation' } ); > > my $checkout = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout >- $checkout->set_columns( { timestamp => $now, issuedate => $one_minute_ago } )->update; # FIXME $checkout is a Koha::Schema::Result::Issues, must be a Koha::Checkout >+ $checkout->set( { timestamp => $now, issuedate => $one_minute_ago } )->store; > my $first_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} ); > > $checkout = C4::Circulation::AddIssue( $patron, $item2->{barcode} ); # Add a second checkout >- $checkout->set_columns( { timestamp => $now, issuedate => $now } )->update; >+ $checkout->set( { timestamp => $now, issuedate => $now } )->store; > my $yesterday = dt_from_string->subtract( days => 1 ); > C4::Circulation::AddIssue( $patron, $item3->{barcode}, $yesterday ); # Add an overdue > my $second_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} ); >@@ -713,11 +713,11 @@ EOF > reset_template( { template => $tt_template, code => $code, module => 'circulation' } ); > > $checkout = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout >- $checkout->set_columns( { timestamp => $now, issuedate => $one_minute_ago } )->update; >+ $checkout->set( { timestamp => $now, issuedate => $one_minute_ago } )->store; > my $first_tt_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} ); > > $checkout = C4::Circulation::AddIssue( $patron, $item2->{barcode} ); # Add a second checkout >- $checkout->set_columns( { timestamp => $now, issuedate => $now } )->update; >+ $checkout->set( { timestamp => $now, issuedate => $now } )->store; > C4::Circulation::AddIssue( $patron, $item3->{barcode}, $yesterday ); # Add an overdue > my $second_tt_slip = C4::Members::IssueSlip( $branchcode, $patron->{borrowernumber} ); > >@@ -776,9 +776,9 @@ EOF > my $issue1 = C4::Circulation::AddIssue( $patron, $item1->{barcode} ); # Add a first checkout > my $issue2 = C4::Circulation::AddIssue( $patron, $item2->{barcode}, $yesterday ); # Add an first overdue > my $issue3 = C4::Circulation::AddIssue( $patron, $item3->{barcode}, $two_days_ago ); # Add an second overdue >- $issue1 = Koha::Checkout->_new_from_dbic( $issue1 )->unblessed; # ->unblessed should be enough but AddIssue does not return a Koha::Checkout object >- $issue2 = Koha::Checkout->_new_from_dbic( $issue2 )->unblessed; >- $issue3 = Koha::Checkout->_new_from_dbic( $issue3 )->unblessed; >+ $issue1 = $issue1->unblessed; >+ $issue2 = $issue2->unblessed; >+ $issue3 = $issue3->unblessed; > > # For items.content > my @item_fields = qw( date_due title barcode author itemnumber ); >-- >2.19.2
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 21999
:
83215
|
83216
|
83244
|
83245
|
83327
|
83328
|
83329
|
83330