Bug 37146: Add tests

(cherry picked from commit 73e62a38f9c20f5ce1ab342940407d4969d5ba93)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
Jonathan Druart 2024-07-11 11:40:35 +02:00 committed by Frédéric Demians
parent 9c5b9d135f
commit f55c0039bd
1 changed files with 15 additions and 1 deletions

View File

@ -3,8 +3,9 @@ use Modern::Perl;
use CGI;
use File::Temp qw/tempfile/;
use Getopt::Long;
use Test::More tests => 7;
use Test::MockModule;
use Test::More tests => 6;
use Test::Warn;
use t::lib::Mocks;
use t::lib::TestBuilder;
@ -58,6 +59,19 @@ subtest 'Test06 -- test biblio_008' => sub {
is( substr($field, 15, 3), '|||', 'Check country fallback for undefined' );
};
subtest 'Test07 -- validate input' => sub {
plan tests => 4;
my $plugin = Koha::FrameworkPlugin->new( { name => '../../misc/maintenance/touch_all_biblios.pl' } );
warning_like { $plugin->launch } qr{Attempt to load};
like( $plugin->errstr, qr{File not found} );
$plugin = Koha::FrameworkPlugin->new( { name => 'non-existent-plugin.pl' } );
warning_like { $plugin->launch } q{};
like( $plugin->errstr, qr{File not found} );
};
$schema->storage->txn_rollback;
sub test01 {