Lines 224-236
subtest 'cancel() tests' => sub {
Link Here
|
224 |
}; |
224 |
}; |
225 |
|
225 |
|
226 |
subtest 'store' => sub { |
226 |
subtest 'store' => sub { |
227 |
plan tests => 2; |
227 |
plan tests => 3; |
228 |
$schema->storage->txn_begin; |
228 |
$schema->storage->txn_begin; |
229 |
|
229 |
|
230 |
t::lib::Mocks::mock_preference( 'ArticleRequestsSupportedFormats', 'SCAN' ); |
230 |
t::lib::Mocks::mock_preference( 'ArticleRequestsSupportedFormats', 'SCAN' ); |
231 |
my $ar = $builder->build_object( { class => 'Koha::ArticleRequests', value => { format => 'PHOTOCOPY' } } ); |
231 |
my $ar = $builder->build_object( { class => 'Koha::ArticleRequests', value => { format => 'PHOTOCOPY' } } ); |
232 |
throws_ok { $ar->format('test')->store } 'Koha::Exceptions::ArticleRequest::WrongFormat', |
232 |
throws_ok { $ar->format('test')->store } 'Koha::Exceptions::ArticleRequest::WrongFormat', |
233 |
'Format not supported'; |
233 |
'Format not supported'; |
|
|
234 |
is( $@->format, 'test', 'Passed format returned with the exception' ); |
234 |
t::lib::Mocks::mock_preference( 'ArticleRequestsSupportedFormats', 'SCAN|PHOTOCOPY|ELSE' ); |
235 |
t::lib::Mocks::mock_preference( 'ArticleRequestsSupportedFormats', 'SCAN|PHOTOCOPY|ELSE' ); |
235 |
lives_ok { $ar->format('PHOTOCOPY')->store } 'Now we do support it'; |
236 |
lives_ok { $ar->format('PHOTOCOPY')->store } 'Now we do support it'; |
236 |
|
237 |
|
237 |
- |
|
|