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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e32e9d49c5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2021-11-15 09:51:53 -03:00 committed by Andrew Fuerste-Henry
parent 04b2b0efd4
commit eac209998f
1 changed files with 41 additions and 1 deletions

View File

@ -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;
};