Bug 22834: Add tests for Koha::Plugins::Base->bundle_path
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4adb1791c6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
b6baccee51
commit
5aed3545f3
|
|
@ -4,12 +4,14 @@ use Modern::Perl;
|
|||
|
||||
use Archive::Extract;
|
||||
use CGI;
|
||||
use Cwd qw(abs_path);
|
||||
use File::Basename;
|
||||
use File::Spec;
|
||||
use File::Temp qw( tempdir tempfile );
|
||||
use FindBin qw($Bin);
|
||||
use Module::Load::Conditional qw(can_load);
|
||||
use Test::MockModule;
|
||||
use Test::More tests => 47;
|
||||
use Test::More tests => 48;
|
||||
|
||||
use C4::Context;
|
||||
use Koha::Database;
|
||||
|
|
@ -221,6 +223,24 @@ subtest 'Test _version_compare' => sub {
|
|||
is( $plugin->_version_compare( '1.0', '1.0.0' ), 0, "1.0 is equal to 1.0.0" );
|
||||
};
|
||||
|
||||
subtest 'bundle_path() tests' => sub {
|
||||
|
||||
plan tests => 1;
|
||||
|
||||
t::lib::Mocks::mock_config( 'enable_plugins', 1 );
|
||||
|
||||
my @current_dir = File::Spec->splitdir(abs_path(__FILE__));
|
||||
# remote Plugins.t
|
||||
pop @current_dir;
|
||||
# remove db_dependent
|
||||
pop @current_dir;
|
||||
|
||||
my $plugin = Koha::Plugin::Test->new;
|
||||
|
||||
is( $plugin->bundle_path, File::Spec->catdir(@current_dir) . '/lib/Koha/Plugin/Test' );
|
||||
|
||||
};
|
||||
|
||||
subtest 'new() tests' => sub {
|
||||
|
||||
plan tests => 2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue