From d447f6c2581c693a4217caf73dbe94cab4f30c0b 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 Signed-off-by: Tomas Cohen Arazi --- 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 d81215fdc2..780c59a3e8 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; };