Bug 20941: Add unit tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Andrew Isherwood 2018-10-02 15:50:51 +01:00 committed by Nick Clemens
parent cc12509c1e
commit 676fbe12ea
1 changed files with 14 additions and 1 deletions

View File

@ -37,7 +37,7 @@ use_ok('Koha::Illrequests');
subtest 'Basic object tests' => sub {
plan tests => 22;
plan tests => 24;
$schema->storage->txn_begin;
@ -85,6 +85,19 @@ subtest 'Basic object tests' => sub {
is($illrq_obj->backend, $illrq->{backend},
"Backend getter works.");
is($illrq_obj->getType, '<span>N/A</span>',
'getType() returns placeholder if no type is set');
$builder->build({
source => 'Illrequestattribute',
value => {
illrequest_id => $illrq_obj->illrequest_id,
type => 'type',
value => 'book'
}
});
is($illrq_obj->getType, 'book',
'getType() returns correct type if set');
isnt($illrq_obj->status, 'COMP',
"ILL is not currently marked complete.");
$illrq_obj->mark_completed;