From 1e8976591e815ec223a2224bcedf3978d1c7b1df 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 761de9f..511bff4 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 => 21; + plan tests => 23; $schema->storage->txn_begin; @@ -83,6 +83,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