Lines 79-85
ok(!$@, 'Destroyed processor successfully');
Link Here
|
79 |
|
79 |
|
80 |
subtest "new() tests" => sub { |
80 |
subtest "new() tests" => sub { |
81 |
|
81 |
|
82 |
plan tests => 13; |
82 |
plan tests => 14; |
83 |
|
83 |
|
84 |
my $processor; |
84 |
my $processor; |
85 |
|
85 |
|
Lines 103-113
subtest "new() tests" => sub {
Link Here
|
103 |
is( ref($processor->filters->[1]), 'Koha::Filter::MARC::EmbedSeeFromHeadings', 'Correct second filter initialized' ); |
103 |
is( ref($processor->filters->[1]), 'Koha::Filter::MARC::EmbedSeeFromHeadings', 'Correct second filter initialized' ); |
104 |
|
104 |
|
105 |
# Create a processor with both valid and invalid filters. |
105 |
# Create a processor with both valid and invalid filters. |
106 |
$processor = new Koha::RecordProcessor({ filters => [ 'Null', 'Dummy' ] }); |
106 |
# use hash reference for regression testing |
|
|
107 |
my $parameters = { |
108 |
filters => [ 'Null', 'Dummy' ], |
109 |
options => { 'test' => 'true' } |
110 |
}; |
111 |
$processor = new Koha::RecordProcessor($parameters); |
107 |
is( ref($processor), 'Koha::RecordProcessor', 'Processor created' ); |
112 |
is( ref($processor), 'Koha::RecordProcessor', 'Processor created' ); |
108 |
is( scalar @{ $processor->filters }, 1, 'Invalid filter skipped' ); |
113 |
is( scalar @{ $processor->filters }, 1, 'Invalid filter skipped' ); |
109 |
is( ref($processor->filters->[0]), 'Koha::Filter::MARC::Null', 'Correct filter initialized' ); |
114 |
is( ref($processor->filters->[0]), 'Koha::Filter::MARC::Null', 'Correct filter initialized' ); |
110 |
|
115 |
|
|
|
116 |
my $filter_params = $processor->filters->[0]->params; |
117 |
is_deeply( $filter_params, $parameters, 'Initialization parameters' ); |
111 |
}; |
118 |
}; |
112 |
|
119 |
|
113 |
done_testing(); |
120 |
done_testing(); |
114 |
- |
|
|