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