View | Details | Raw Unified | Return to bug 34529
Collapse All | Expand All

(-)a/t/db_dependent/Circulation/OfflineCirculation.t (-3 / +51 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 1;
20
use Test::More tests => 2;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 25-31 use t::lib::Mocks; Link Here
25
use t::lib::TestBuilder;
25
use t::lib::TestBuilder;
26
26
27
use C4::Biblio qw( AddBiblio );
27
use C4::Biblio qw( AddBiblio );
28
use C4::Circulation qw( AddOfflineOperation ProcessOfflineOperation GetOfflineOperation );
28
use C4::Circulation qw( AddOfflineOperation ProcessOfflineOperation GetOfflineOperation ProcessOfflineIssue );
29
use C4::Context;
29
use C4::Context;
30
use C4::Reserves qw( AddReserve );
30
use C4::Reserves qw( AddReserve );
31
use Koha::DateUtils qw( dt_from_string );
31
use Koha::DateUtils qw( dt_from_string );
Lines 55-60 my $dbh = C4::Context->dbh; Link Here
55
55
56
my $builder = t::lib::TestBuilder->new();
56
my $builder = t::lib::TestBuilder->new();
57
57
58
subtest "Bug 34529: Offline circulation should be able to accept userid as well as cardnumber" => sub {
59
60
    plan tests => 2;
61
62
    $dbh->do("DELETE FROM pending_offline_operations");
63
64
    $branch = $builder->build( { source => 'Branch' } )->{branchcode};
65
66
    my $borrower1 = $builder->build(
67
        {
68
            source => 'Borrower',
69
            value  => { branchcode => $branch }
70
        }
71
    );
72
73
    my $biblio = t::lib::TestBuilder->new->build_sample_biblio;
74
    my $item1  = $builder->build_sample_item(
75
        {
76
            biblionumber => $biblio->id,
77
            library      => $branch,
78
        }
79
    );
80
    my $item2 = $builder->build_sample_item(
81
        {
82
            biblionumber => $biblio->id,
83
            library      => $branch,
84
        }
85
    );
86
87
    is(
88
        ProcessOfflineIssue(
89
            {
90
                cardnumber => $borrower1->{cardnumber},
91
                barcode    => $item1->barcode
92
            }
93
        ),
94
        "Success.",
95
        "ProcessOfflineIssue succeeds with cardnumber"
96
    );
97
    is(
98
        ProcessOfflineIssue(
99
            { cardnumber => $borrower1->{userid}, barcode => $item2->barcode }
100
        ),
101
        "Success.",
102
        "ProcessOfflineIssue succeeds with user id"
103
    );
104
105
  };
106
58
subtest "Bug 30114 - Koha offline circulation will always cancel the next hold when issuing item to a patron" => sub {
107
subtest "Bug 30114 - Koha offline circulation will always cancel the next hold when issuing item to a patron" => sub {
59
108
60
    plan tests => 3;
109
    plan tests => 3;
61
- 

Return to bug 34529