Bug 27166: Unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2020-12-08 14:18:11 +00:00 committed by Jonathan Druart
parent cae0ef76f3
commit 3126ae3443

View file

@ -272,9 +272,10 @@ subtest do_hold => sub {
};
subtest do_checkin => sub {
plan tests => 8;
plan tests => 11;
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
my $patron = $builder->build_object(
{
class => 'Koha::Patrons',
@ -320,6 +321,12 @@ subtest do_checkin => sub {
is( $patron->checkouts->count, 1, 'Checkout should have been done successfully');
$ci_transaction->do_checkin($library->branchcode, undef);
is( $patron->checkouts->count, 0, 'Checkin should have been done successfully');
my $result = $ci_transaction->do_checkin($library2->branchcode, undef);
is($ci_transaction->alert_type,'04',"Checkin of item no issued at another branch succeeds");
is_deeply($result,{ messages => { 'NotIssued' => $item->barcode, 'WasTransfered' => 1 } },"Messages show not issued and transferred");
is( $ci_transaction->item->destination_loc,$library->branchcode,"Item destination correctly set");
};
subtest checkin_lost => sub {