From cb3282ef59aa3818c746df4477f4f52a06da04f5 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Tue, 2 Oct 2018 15:50:51 +0100 Subject: [PATCH] Bug 20941: Add unit tests Signed-off-by: Josef Moravec --- t/db_dependent/Illrequests.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t index 36ecc89..3f7ba1e 100644 --- a/t/db_dependent/Illrequests.t +++ b/t/db_dependent/Illrequests.t @@ -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, 'N/A', + '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; -- 2.1.4