From 26c96a026b34287531fb97f9fe3e402fc6c700e2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 17 Oct 2023 15:54:31 +0000 Subject: [PATCH] Bug 22632: (follow-up) Apply perltidy fixes and add missing exec flag to Log.t Signed-off-by: David Nind --- t/db_dependent/Koha/Patron/Log.t | 67 +++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 22 deletions(-) mode change 100644 => 100755 t/db_dependent/Koha/Patron/Log.t diff --git a/t/db_dependent/Koha/Patron/Log.t b/t/db_dependent/Koha/Patron/Log.t old mode 100644 new mode 100755 index 02ff9602ee..0aafcd074a --- a/t/db_dependent/Koha/Patron/Log.t +++ b/t/db_dependent/Koha/Patron/Log.t @@ -29,48 +29,71 @@ subtest 'Test Koha::Patrons::merge' => sub { plan tests => 4; my $builder = t::lib::TestBuilder->new; - my $keeper = $builder->build_object({ class => 'Koha::Patrons' }); + my $keeper = $builder->build_object( { class => 'Koha::Patrons' } ); - my $borrower1 = $builder->build({source => 'Borrower'}); - my $borrower2 = $builder->build({source => 'Borrower'}); - my $borrower3 = $builder->build({source => 'Borrower'}); - my $borrower4 = $builder->build({source => 'Borrower'}); + my $borrower1 = $builder->build( { source => 'Borrower' } ); + my $borrower2 = $builder->build( { source => 'Borrower' } ); + my $borrower3 = $builder->build( { source => 'Borrower' } ); + my $borrower4 = $builder->build( { source => 'Borrower' } ); #test with BorrowersLog on - t::lib::Mocks::mock_preference('BorrowersLog', 1); + t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); - my $results = $keeper->merge_with([ $borrower1->{borrowernumber}, $borrower2->{borrowernumber} ]); + my $results = $keeper->merge_with( [ $borrower1->{borrowernumber}, $borrower2->{borrowernumber} ] ); - my $log=GetLogs("","","",["MEMBERS"],["PATRON_MERGE"],$keeper->id,""); + my $log = GetLogs( "", "", "", ["MEMBERS"], ["PATRON_MERGE"], $keeper->id, "" ); - my $info_borrower1 = $borrower1->{firstname} . " " . $borrower1->{surname} . " (" . $borrower1->{cardnumber} . ") has been merged into " . - $keeper->firstname . " " . $keeper->surname . " (" . $keeper->cardnumber . ")"; + my $info_borrower1 = + $borrower1->{firstname} . " " + . $borrower1->{surname} . " (" + . $borrower1->{cardnumber} + . ") has been merged into " + . $keeper->firstname . " " + . $keeper->surname . " (" + . $keeper->cardnumber . ")"; my $info_log = $log->[0]{info}; - is($info_log,$info_borrower1,"GetLogs returns results in the log viewer for the merge of " . $borrower1->{borrowernumber}); - - my $info_borrower2 = $borrower2->{firstname} . " " . $borrower2->{surname} . " (" . $borrower2->{cardnumber} . ") has been merged into " . - $keeper->firstname . " " . $keeper->surname . " (" . $keeper->cardnumber . ")"; + is( + $info_log, $info_borrower1, + "GetLogs returns results in the log viewer for the merge of " . $borrower1->{borrowernumber} + ); + + my $info_borrower2 = + $borrower2->{firstname} . " " + . $borrower2->{surname} . " (" + . $borrower2->{cardnumber} + . ") has been merged into " + . $keeper->firstname . " " + . $keeper->surname . " (" + . $keeper->cardnumber . ")"; $info_log = $log->[1]{info}; - is($info_log,$info_borrower2,"GetLogs returns results in the log viewer for the merge of " . $borrower2->{borrowernumber}); - + is( + $info_log, $info_borrower2, + "GetLogs returns results in the log viewer for the merge of " . $borrower2->{borrowernumber} + ); #test with BorrowersLog off - t::lib::Mocks::mock_preference('BorrowersLog', 0); + t::lib::Mocks::mock_preference( 'BorrowersLog', 0 ); - $keeper = $builder->build_object({ class => 'Koha::Patrons' }); + $keeper = $builder->build_object( { class => 'Koha::Patrons' } ); - $results = $keeper->merge_with([ $borrower3->{borrowernumber}, $borrower4->{borrowernumber} ]); + $results = $keeper->merge_with( [ $borrower3->{borrowernumber}, $borrower4->{borrowernumber} ] ); - $log=GetLogs("","","",["MEMBERS"],["PATRON_MERGE"],$keeper->id,""); + $log = GetLogs( "", "", "", ["MEMBERS"], ["PATRON_MERGE"], $keeper->id, "" ); $info_log = $log->[0]{info}; - is($info_log,undef,"GetLogs didn't returns results in the log viewer for the merge of " . $borrower3->{borrowernumber}); + is( + $info_log, undef, + "GetLogs didn't returns results in the log viewer for the merge of " . $borrower3->{borrowernumber} + ); $info_log = $log->[1]{info}; - is($info_log,undef,"GetLogs didn't returns results in the log viewer for the merge of " . $borrower4->{borrowernumber}); + is( + $info_log, undef, + "GetLogs didn't returns results in the log viewer for the merge of " . $borrower4->{borrowernumber} + ); }; $schema->storage->txn_rollback; -- 2.30.2