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 93-96
subtest 'Test Koha::Checkout::claim_returned' => sub {
Link Here
|
93 |
ok( $claim->created_on, "Claim created_on is set" ); |
93 |
ok( $claim->created_on, "Claim created_on is set" ); |
94 |
}; |
94 |
}; |
95 |
|
95 |
|
|
|
96 |
subtest 'Test Koha::Patronn::return_claims' => sub { |
97 |
plan tests => 7; |
98 |
|
99 |
t::lib::Mocks::mock_preference( 'ClaimReturnedLostValue', 1 ); |
100 |
my $biblio = $builder->build_object( { class => 'Koha::Biblios' } ); |
101 |
my $item = $builder->build_object( |
102 |
{ |
103 |
class => 'Koha::Items', |
104 |
value => { |
105 |
biblionumber => $biblio->biblionumber, |
106 |
notforloan => 0, |
107 |
itemlost => 0, |
108 |
withdrawn => 0, |
109 |
} |
110 |
} |
111 |
); |
112 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
113 |
my $checkout = AddIssue( $patron->unblessed, $item->barcode ); |
114 |
|
115 |
$checkout->claim_returned( |
116 |
{ |
117 |
created_by => $patron->id, |
118 |
notes => "Test note", |
119 |
} |
120 |
); |
121 |
|
122 |
my $claims = $patron->return_claims; |
123 |
|
124 |
is( $claims->count, 1, "Got back correct number of claims" ); |
125 |
|
126 |
my $claim = $claims->next; |
127 |
|
128 |
is( $claim->issue_id, $checkout->id, "Claim issue id matches" ); |
129 |
is( $claim->itemnumber, $item->id, "Claim itemnumber matches" ); |
130 |
is( $claim->borrowernumber, $patron->id, "Claim borrowernumber matches" ); |
131 |
is( $claim->notes, "Test note", "Claim notes match" ); |
132 |
is( $claim->created_by, $patron->id, "Claim created_by matches" ); |
133 |
ok( $claim->created_on, "Claim created_on is set" ); |
134 |
}; |
135 |
|
96 |
$schema->storage->txn_rollback; |
136 |
$schema->storage->txn_rollback; |
97 |
- |
|
|