From e70e74c31fdff55690a38f874874d28d87931263 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 29 Aug 2023 15:16:53 +0000 Subject: [PATCH] Bug 33970: Fix tests Signed-off-by: Martin Renvoize --- t/db_dependent/Illrequestattributes.t | 39 ++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/t/db_dependent/Illrequestattributes.t b/t/db_dependent/Illrequestattributes.t index d81215fdc27..780c59a3e80 100755 --- a/t/db_dependent/Illrequestattributes.t +++ b/t/db_dependent/Illrequestattributes.t @@ -30,7 +30,7 @@ use_ok('Koha::Illrequestattributes'); subtest 'Basic object tests' => sub { - plan tests => 5; + plan tests => 6; $schema->storage->txn_begin; @@ -38,25 +38,40 @@ subtest 'Basic object tests' => sub { my $builder = t::lib::TestBuilder->new; - my $illrqattr = $builder->build({ source => 'Illrequestattribute' }); + my $illrqattr = $builder->build( { source => 'Illrequestattribute' } ); my $illrqattr_obj = Koha::Illrequestattributes->find( $illrqattr->{illrequest_id}, + $illrqattr->{backend}, $illrqattr->{type} ); - isa_ok($illrqattr_obj, 'Koha::Illrequestattribute', - "Correctly create and load an illrequestattribute object."); - is($illrqattr_obj->illrequest_id, $illrqattr->{illrequest_id}, - "Illrequest_id getter works."); - is($illrqattr_obj->type, $illrqattr->{type}, - "Type getter works."); - is($illrqattr_obj->value, $illrqattr->{value}, - "Value getter works."); + isa_ok( + $illrqattr_obj, 'Koha::Illrequestattribute', + "Correctly create and load an illrequestattribute object." + ); + is( + $illrqattr_obj->illrequest_id, $illrqattr->{illrequest_id}, + "Illrequest_id getter works." + ); + is( + $illrqattr_obj->backend, $illrqattr->{backend}, + "Backend getter works." + ); + is( + $illrqattr_obj->type, $illrqattr->{type}, + "Type getter works." + ); + is( + $illrqattr_obj->value, $illrqattr->{value}, + "Value getter works." + ); $illrqattr_obj->delete; - is(Koha::Illrequestattributes->search->count, 0, - "No attributes found after delete."); + is( + Koha::Illrequestattributes->search->count, 0, + "No attributes found after delete." + ); $schema->storage->txn_rollback; }; -- 2.41.0