Bug 33970: Fix tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-08-29 15:16:53 +00:00 committed by Tomas Cohen Arazi
parent 052217e5e2
commit d447f6c258
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -30,7 +30,7 @@ use_ok('Koha::Illrequestattributes');
subtest 'Basic object tests' => sub { subtest 'Basic object tests' => sub {
plan tests => 5; plan tests => 6;
$schema->storage->txn_begin; $schema->storage->txn_begin;
@ -42,21 +42,36 @@ subtest 'Basic object tests' => sub {
my $illrqattr_obj = Koha::Illrequestattributes->find( my $illrqattr_obj = Koha::Illrequestattributes->find(
$illrqattr->{illrequest_id}, $illrqattr->{illrequest_id},
$illrqattr->{backend},
$illrqattr->{type} $illrqattr->{type}
); );
isa_ok($illrqattr_obj, 'Koha::Illrequestattribute', isa_ok(
"Correctly create and load an illrequestattribute object."); $illrqattr_obj, 'Koha::Illrequestattribute',
is($illrqattr_obj->illrequest_id, $illrqattr->{illrequest_id}, "Correctly create and load an illrequestattribute object."
"Illrequest_id getter works."); );
is($illrqattr_obj->type, $illrqattr->{type}, is(
"Type getter works."); $illrqattr_obj->illrequest_id, $illrqattr->{illrequest_id},
is($illrqattr_obj->value, $illrqattr->{value}, "Illrequest_id getter works."
"Value 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; $illrqattr_obj->delete;
is(Koha::Illrequestattributes->search->count, 0, is(
"No attributes found after delete."); Koha::Illrequestattributes->search->count, 0,
"No attributes found after delete."
);
$schema->storage->txn_rollback; $schema->storage->txn_rollback;
}; };