Lines 2-8
Link Here
|
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
use Test::More tests => 14; |
4 |
use Test::More tests => 14; |
5 |
use File::Basename; |
5 |
use Cwd qw(abs_path); |
6 |
use File::Temp qw/tempfile/; |
6 |
use File::Temp qw/tempfile/; |
7 |
|
7 |
|
8 |
use t::lib::Mocks; |
8 |
use t::lib::Mocks; |
Lines 12-17
use Koha::Database;
Link Here
|
12 |
use Koha::Plugins; |
12 |
use Koha::Plugins; |
13 |
|
13 |
|
14 |
BEGIN { |
14 |
BEGIN { |
|
|
15 |
# Mock pluginsdir before loading Plugins module |
16 |
my $path = abs_path(__FILE__); |
17 |
$path =~ s/(\/[^\/]+){2}$//; # remove db_dependent and filename |
18 |
t::lib::Mocks::mock_config( 'pluginsdir', $path ); |
15 |
use_ok('C4::ImportBatch'); |
19 |
use_ok('C4::ImportBatch'); |
16 |
} |
20 |
} |
17 |
|
21 |
|
Lines 182-188
subtest "RecordsFromMarcPlugin" => sub {
Link Here
|
182 |
100,a = Another |
186 |
100,a = Another |
183 |
245,a = Noise in the library|; |
187 |
245,a = Noise in the library|; |
184 |
close $fh; |
188 |
close $fh; |
185 |
t::lib::Mocks::mock_config( 'pluginsdir', dirname(__FILE__) . '/..' ); |
189 |
|
186 |
my ( $plugin ) = Koha::Plugins->new->GetPlugins({ metadata => { name => 'MarcFieldValues' } }); |
190 |
my ( $plugin ) = Koha::Plugins->new->GetPlugins({ metadata => { name => 'MarcFieldValues' } }); |
187 |
isnt( $plugin, undef, "Plugin found" ); |
191 |
isnt( $plugin, undef, "Plugin found" ); |
188 |
my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' ); |
192 |
my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' ); |
189 |
- |
|
|