Bug 38944: Manual changes

Not caught by the script

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2025-01-22 14:43:15 +01:00 committed by Katrin Fischer
parent 5b69e6df98
commit df76c8a9e7
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
32 changed files with 51 additions and 75 deletions

View File

@ -17,7 +17,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 2;
use File::Find;
SKIP: {
@ -29,14 +29,12 @@ SKIP: {
find( \&wanted, $dir );
sub wanted {
return if $_ eq 'skeleton.pl';
return if $_ eq 'README';
return if $_ eq '.';
push @files, $_;
return;
}
foreach my $f (@files) {
next if $f eq 'skeleton.pl';
unlike( $f, qr/.*pl$/, "check for unhandled atomic updates: $f" );
}
is( scalar(@files), 0, "No atomic updates" ) or diag join "\n", @files;
}
done_testing();

View File

@ -19,7 +19,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::NoWarnings qw( had_no_warnings );
use Test::More;
use File::Spec;
use File::Find;
@ -101,5 +101,5 @@ sub is_testable {
return $return_value;
}
had_no_warnings;
done_testing();

View File

@ -3,7 +3,7 @@
# This script can be used to run perlcritic on perl files in koha
use Modern::Perl;
use Test::NoWarnings;
use Test::NoWarnings qw( had_no_warnings );
use Test::More;
use English qw(-no_match_vars);
@ -17,3 +17,5 @@ if ($EVAL_ERROR) {
Test::Perl::Critic->import( -profile => '.perlcriticrc' );
my @files = map { chomp; $_ } `git ls-tree -r HEAD --name-only`; # only files part of git
all_critic_ok(@files);
had_no_warnings;

View File

@ -15,10 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use strict;
use warnings;
use Modern::Perl;
use Test::NoWarnings;
use Test::NoWarnings qw( had_no_warnings );
use Test::More;
use File::Spec;
use File::Find;
@ -44,6 +43,9 @@ find(
}
},
},
,
File::Spec->curdir()
);
had_no_warnings;
done_testing();

View File

@ -18,12 +18,10 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 33;
use Test::MockModule;
use Test::Warn;
plan tests => 32;
use_ok(
'C4::Biblio',
qw( AddBiblio ModBiblio BiblioAutoLink LinkBibHeadingsToAuthorities GetMarcPrice GetMarcQuantity GetMarcISBN GetMarcISSN GetMarcSubjects GetMarcUrls GetMarcSeries TransformMarcToKoha ModBiblioMarc RemoveAllNsb UpdateTotalIssues )

View File

@ -2,7 +2,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 3;
use Test::MockModule;
use MARC::Record;
@ -58,5 +58,3 @@ sub _koha_marc_update_bib_ids_control {
is( $r->field('001')->data(), 10, 'Biblionumber to control field' );
is( $r->field('004')->data(), 20, 'Biblioitemnumber to control field' );
}
done_testing();

View File

@ -2,7 +2,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 6;
use Test::Exception;
BEGIN { use_ok('Koha::DateTime::Format::RFC3339'); }
@ -58,5 +58,3 @@ subtest 'invalid date throws an exception' => sub {
}
qr/Invalid date format/;
};
done_testing;

View File

@ -5,7 +5,7 @@ use DateTime::TimeZone;
use Test::Exception;
use Test::MockModule;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 6;
BEGIN { use_ok('Koha::DateTime::Format::SQL'); }
@ -81,5 +81,3 @@ subtest 'normal datetime, with timezone configured' => sub {
is( $dt->second, 12 );
is( $dt->time_zone->name, 'floating' );
};
done_testing;

View File

@ -20,7 +20,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 4;
use_ok('Koha::SearchEngine::Elasticsearch::Browse');
@ -77,5 +77,3 @@ subtest "_build_query tests" => sub {
'Fuzziness and size specified'
);
};
done_testing();

View File

@ -17,8 +17,7 @@
#
# for context, see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2691
use strict;
use warnings;
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
@ -42,7 +41,7 @@ BEGIN {
$test_num += 2 * $split_num;
$test_num += 4;
}
plan tests => $test_num;
plan tests => $test_num + 1;
use_ok('C4::Labels::Label');
use vars qw($ccns);
}

View File

@ -17,8 +17,7 @@
#
# for context, see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2691
use strict;
use warnings;
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
@ -41,7 +40,7 @@ BEGIN {
$test_num += 2 * $split_num;
$test_num += 4;
}
plan tests => $test_num;
plan tests => $test_num + 1;
use_ok( 'C4::ClassSplitRoutine::Dewey', qw( split_callnumber ) );
use vars qw($ddcns);
}

View File

@ -17,8 +17,7 @@
#
# for context, see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2691
use strict;
use warnings;
use Modern::Perl;
use C4::ClassSplitRoutine::LCC qw( split_callnumber );
use Test::NoWarnings;
@ -44,7 +43,7 @@ BEGIN {
$test_num += 2 * $split_num;
$test_num += 4;
}
plan tests => $test_num;
plan tests => $test_num + 1;
use_ok('C4::Labels::Label');
use vars qw($lccns);
}

View File

@ -23,7 +23,7 @@ use File::Spec;
use MARC::Record;
use English qw( -no_match_vars );
use Test::NoWarnings;
use Test::More;
use Test::More tests => 21;
BEGIN {
use_ok('Koha::RecordProcessor');
@ -236,5 +236,3 @@ subtest "'TrimFields' filter tests" => sub {
my $get521a = $record->subfield( '521', 'a' );
is( $get521a, "This is a\t test!", "Trailing tabs are stripped while inner tabs are kept" );
};
done_testing();

View File

@ -1,10 +1,9 @@
#!/usr/bin/perl
use strict;
use warnings;
use Modern::Perl;
use File::Spec;
use Test::NoWarnings;
use Test::NoWarnings qw( had_no_warnings );
use Test::More;
BEGIN {
@ -53,4 +52,5 @@ eval {
};
ok( !$@, 'Destroyed suggestor successfully' );
had_no_warnings;
done_testing();

View File

@ -1,11 +1,10 @@
#!/usr/bin/perl
# This script is called by the pre-commit git hook to test modules compile
use strict;
use warnings;
use Modern::Perl;
use threads; # used for parallel
use Test::NoWarnings;
use Test::NoWarnings qw( had_no_warnings );
use Test::More;
use Test::Strict;
use Parallel::ForkManager;
@ -55,4 +54,5 @@ foreach my $d (@dirs) {
$pm->wait_all_children;
had_no_warnings;
done_testing();

View File

@ -3,7 +3,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 4;
use C4::Acquisition qw( NewBasket GetOrders GetOrdersByBiblionumber GetOrder );
use C4::Biblio qw( AddBiblio );
use C4::Budgets qw( AddBudget GetBudget );
@ -89,5 +89,3 @@ is( scalar(@orders), 2, '2 orders on biblionumber 2' );
#End transaction
$schema->storage->txn_rollback();
done_testing;

View File

@ -3,7 +3,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 2;
use Koha::Database;
use Koha::Acquisition::Budget;
@ -13,8 +13,6 @@ use C4::Budgets qw(AddBudget CloneBudgetHierarchy GetBudgetHierarchy);
use t::lib::TestBuilder;
plan tests => 1;
my $schema = Koha::Database->schema;
my $builder = t::lib::TestBuilder->new;

View File

@ -17,7 +17,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More tests => 10;
use Test::More tests => 11;
use utf8;
use Koha::Database;

View File

@ -17,7 +17,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More tests => 8;
use Test::More tests => 9;
use Test::Warn;
use utf8;

View File

@ -11,7 +11,7 @@ use Module::Load::Conditional qw( can_load check_install );
BEGIN {
if ( check_install( module => 'WebService::ILS::OverDrive::Patron' ) ) {
plan tests => 6;
plan tests => 7;
} else {
plan skip_all => "Need WebService::ILS::OverDrive::Patron";
}

View File

@ -30,7 +30,7 @@ my @prices2test = (
{ string => '5.99 (7.75 CAN)', expected => '5.99' },
);
plan tests => 2 * scalar @prices2test;
plan tests => 1 + 2 * scalar @prices2test;
# set active currency test data
my $CURRENCY = 'TEST';

View File

@ -17,14 +17,13 @@
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use strict;
use warnings;
use Modern::Perl;
use File::Spec;
use MARC::Record;
use Koha::MetadataRecord::Authority;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 5;
use Test::MockModule;
use Test::MockObject;
@ -113,5 +112,3 @@ subtest "EmbedSeeFromHeadings should skip holdings fields" => sub {
is_deeply( $result, $record_copy, 'Holdings fields not processed to introduce See-from heading' );
};
done_testing();

View File

@ -521,5 +521,3 @@ subtest 'LoadSearchHistoryToTheFirstLoggedUser working' => sub {
$result2 = $schema->resultset('SearchHistory')->search()->count;
is( $result2, $result + 1, 'new search added to borrower' );
};
done_testing;

View File

@ -37,7 +37,7 @@ my $schema = Koha::Database->new->schema;
my $builder = t::lib::TestBuilder->new();
if ( can_load( modules => { 'Net::OAuth2::AuthorizationServer' => undef } ) ) {
plan tests => 2;
plan tests => 3;
} else {
plan skip_all => 'Net::OAuth2::AuthorizationServer not available';
}

View File

@ -17,7 +17,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::NoWarnings qw( had_no_warnings );
use Test::More;
use Koha::Database;
@ -62,6 +62,5 @@ for my $modules (@modules) {
}
}
}
had_no_warnings;
done_testing();

View File

@ -42,7 +42,7 @@ eval { require Selenium::Remote::Driver; };
if ($@) {
plan skip_all => "Selenium::Remote::Driver is needed for selenium tests.";
} else {
plan tests => 2;
plan tests => 3;
}
my $s = t::lib::Selenium->new;

View File

@ -34,7 +34,7 @@ eval { require Selenium::Remote::Driver; };
if ($@) {
plan skip_all => "Selenium::Remote::Driver is needed for selenium tests.";
} else {
plan tests => 1;
plan tests => 2;
}
my $s = t::lib::Selenium->new;

View File

@ -34,7 +34,7 @@ eval { require Selenium::Remote::Driver; };
if ($@) {
plan skip_all => "Selenium::Remote::Driver is needed for selenium tests.";
} else {
plan tests => 2;
plan tests => 3;
}
my $s = t::lib::Selenium->new;

View File

@ -27,7 +27,7 @@ eval { require Selenium::Remote::Driver; };
if ($@) {
plan skip_all => "Selenium::Remote::Driver is needed for Selenium tests.";
} else {
plan tests => 1;
plan tests => 2;
}
my @cleanup;

View File

@ -33,7 +33,7 @@ eval { require Selenium::Remote::Driver; };
if ($@) {
plan skip_all => "Selenium::Remote::Driver is needed for selenium tests.";
} else {
plan tests => 1;
plan tests => 2;
}
my $s = t::lib::Selenium->new;

View File

@ -29,7 +29,7 @@ if ($@) {
} elsif ( not defined $intranet ) {
plan skip_all => "Tests skip. You must set env. variable KOHA_INTRANET_URL to do tests\n";
} else {
plan tests => 1;
plan tests => 2;
}
$intranet =~ s#/$##;

View File

@ -1,6 +1,6 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More;
use Test::More tests => 5;
use YAML::XS;
use Template;
@ -72,4 +72,3 @@ is_deeply(
}
]
);
done_testing;