Bugzilla – Attachment 90899 Details for
Bug 23177
Rollback cleanup in Circulation.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23177: (QA follow-up) Move three subs from the middle to the top in Circulation.t
Bug-23177-QA-follow-up-Move-three-subs-from-the-mi.patch (text/plain), 4.81 KB, created by
Martin Renvoize (ashimema)
on 2019-06-21 11:32:38 UTC
(
hide
)
Description:
Bug 23177: (QA follow-up) Move three subs from the middle to the top in Circulation.t
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-06-21 11:32:38 UTC
Size:
4.81 KB
patch
obsolete
>From d533c3cde70d91820d49f82892ef38545fd852ef Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 21 Jun 2019 09:00:27 +0000 >Subject: [PATCH] Bug 23177: (QA follow-up) Move three subs from the middle to > the top in Circulation.t > >Removed trailing comma for last sub too. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Circulation.t | 96 ++++++++++++++++++------------------ > 1 file changed, 47 insertions(+), 49 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index eb8be21a9a..bc15512167 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -48,6 +48,53 @@ use Koha::Account::Lines; > use Koha::Account::Offsets; > use Koha::ActionLogs; > >+sub set_userenv { >+ my ( $library ) = @_; >+ t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} }); >+} >+ >+sub str { >+ my ( $error, $question, $alert ) = @_; >+ my $s; >+ $s = %$error ? ' (error: ' . join( ' ', keys %$error ) . ')' : ''; >+ $s .= %$question ? ' (question: ' . join( ' ', keys %$question ) . ')' : ''; >+ $s .= %$alert ? ' (alert: ' . join( ' ', keys %$alert ) . ')' : ''; >+ return $s; >+} >+ >+sub test_debarment_on_checkout { >+ my ($params) = @_; >+ my $item = $params->{item}; >+ my $library = $params->{library}; >+ my $patron = $params->{patron}; >+ my $due_date = $params->{due_date} || dt_from_string; >+ my $return_date = $params->{return_date} || dt_from_string; >+ my $expected_expiration_date = $params->{expiration_date}; >+ >+ $expected_expiration_date = output_pref( >+ { >+ dt => $expected_expiration_date, >+ dateformat => 'sql', >+ dateonly => 1, >+ } >+ ); >+ my @caller = caller; >+ my $line_number = $caller[2]; >+ AddIssue( $patron, $item->{barcode}, $due_date ); >+ >+ my ( undef, $message ) = AddReturn( $item->{barcode}, $library->{branchcode}, undef, $return_date ); >+ is( $message->{WasReturned} && exists $message->{Debarred}, 1, 'AddReturn must have debarred the patron' ) >+ or diag('AddReturn returned message ' . Dumper $message ); >+ my $debarments = Koha::Patron::Debarments::GetDebarments( >+ { borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); >+ is( scalar(@$debarments), 1, 'Test at line ' . $line_number ); >+ >+ is( $debarments->[0]->{expiration}, >+ $expected_expiration_date, 'Test at line ' . $line_number ); >+ Koha::Patron::Debarments::DelUniqueDebarment( >+ { borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); >+}; >+ > my $schema = Koha::Database->schema; > $schema->storage->txn_begin; > my $builder = t::lib::TestBuilder->new; >@@ -3112,55 +3159,6 @@ subtest 'ProcessOfflinePayment() tests' => sub { > $schema->storage->txn_rollback; > }; > >- >- >-sub set_userenv { >- my ( $library ) = @_; >- t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} }); >-} >- >-sub str { >- my ( $error, $question, $alert ) = @_; >- my $s; >- $s = %$error ? ' (error: ' . join( ' ', keys %$error ) . ')' : ''; >- $s .= %$question ? ' (question: ' . join( ' ', keys %$question ) . ')' : ''; >- $s .= %$alert ? ' (alert: ' . join( ' ', keys %$alert ) . ')' : ''; >- return $s; >-} >- >-sub test_debarment_on_checkout { >- my ($params) = @_; >- my $item = $params->{item}; >- my $library = $params->{library}; >- my $patron = $params->{patron}; >- my $due_date = $params->{due_date} || dt_from_string; >- my $return_date = $params->{return_date} || dt_from_string; >- my $expected_expiration_date = $params->{expiration_date}; >- >- $expected_expiration_date = output_pref( >- { >- dt => $expected_expiration_date, >- dateformat => 'sql', >- dateonly => 1, >- } >- ); >- my @caller = caller; >- my $line_number = $caller[2]; >- AddIssue( $patron, $item->{barcode}, $due_date ); >- >- my ( undef, $message ) = AddReturn( $item->{barcode}, $library->{branchcode}, undef, $return_date ); >- is( $message->{WasReturned} && exists $message->{Debarred}, 1, 'AddReturn must have debarred the patron' ) >- or diag('AddReturn returned message ' . Dumper $message ); >- my $debarments = Koha::Patron::Debarments::GetDebarments( >- { borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); >- is( scalar(@$debarments), 1, 'Test at line ' . $line_number ); >- >- is( $debarments->[0]->{expiration}, >- $expected_expiration_date, 'Test at line ' . $line_number ); >- Koha::Patron::Debarments::DelUniqueDebarment( >- { borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); >-}; >- > subtest 'Incremented fee tests' => sub { > plan tests => 11; > >-- >2.20.1
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 23177
:
90880
|
90881
|
90882
| 90899 |
90900
|
90901
|
90902
|
92175