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:
parent
052217e5e2
commit
d447f6c258
1 changed files with 27 additions and 12 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue