Bug 29484: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
988d8c0bd0
commit
dd711f6063
|
|
@ -21,7 +21,7 @@ use Modern::Perl;
|
|||
use Test::Deep qw( cmp_deeply re );
|
||||
use Test::MockTime qw/set_fixed_time set_relative_time restore_time/;
|
||||
|
||||
use Test::More tests => 33;
|
||||
use Test::More tests => 34;
|
||||
use DateTime;
|
||||
use File::Basename;
|
||||
use File::Spec;
|
||||
|
|
@ -865,3 +865,43 @@ subtest 'Tests for timestamp handling' => sub {
|
|||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
subtest 'ListSets() tests' => sub {
|
||||
|
||||
plan tests => 2;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
# initial cleanup
|
||||
$schema->resultset('OaiSet')->delete;
|
||||
|
||||
test_query(
|
||||
'ListSets - no sets should return a noSetHierarchy exception',
|
||||
{ verb => 'ListSets' },
|
||||
{
|
||||
error => {
|
||||
code => 'noSetHierarchy',
|
||||
content => 'There are no OAI sets defined',
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
# Add a couple sets
|
||||
AddOAISet({ spec => 'set_1', name => 'Set 1' });
|
||||
AddOAISet({ spec => 'set_2', name => 'Set 2' });
|
||||
|
||||
test_query(
|
||||
'ListSets - no sets should return a noSetHierarchy exception',
|
||||
{ verb => 'ListSets' },
|
||||
{
|
||||
ListSets => {
|
||||
set => [
|
||||
{ setSpec => 'set_1', setName => 'Set 1' },
|
||||
{ setSpec => 'set_2', setName => 'Set 2' },
|
||||
]
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue