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 {
plan tests => 5;
plan tests => 6;
$schema->storage->txn_begin;
@ -42,21 +42,36 @@ subtest 'Basic object tests' => sub {
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;
};