Lines 21-27
Link Here
|
21 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
21 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
22 |
|
22 |
|
23 |
use Modern::Perl; |
23 |
use Modern::Perl; |
24 |
use Test::More tests => 5; |
24 |
use Test::More tests => 6; |
25 |
use Test::MockObject; |
25 |
use Test::MockObject; |
26 |
use Test::MockModule; |
26 |
use Test::MockModule; |
27 |
use Test::Warn; |
27 |
use Test::Warn; |
Lines 82-87
subtest 'Test hold_patron_bcode' => sub {
Link Here
|
82 |
$schema->storage->txn_rollback; |
82 |
$schema->storage->txn_rollback; |
83 |
}; |
83 |
}; |
84 |
|
84 |
|
|
|
85 |
subtest 'hold_patron_name() tests' => sub { |
86 |
|
87 |
plan tests => 2; |
88 |
|
89 |
my $schema = Koha::Database->new->schema; |
90 |
$schema->storage->txn_begin; |
91 |
|
92 |
my $builder = t::lib::TestBuilder->new(); |
93 |
|
94 |
my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; |
95 |
my ( $response, $findpatron ); |
96 |
my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); |
97 |
|
98 |
my $item = $builder->build_sample_item( |
99 |
{ |
100 |
damaged => 0, |
101 |
withdrawn => 0, |
102 |
itemlost => 0, |
103 |
restricted => 0, |
104 |
homebranch => $branchcode, |
105 |
holdingbranch => $branchcode |
106 |
} |
107 |
); |
108 |
|
109 |
my $server = { ils => $mocks->{ils} }; |
110 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
111 |
|
112 |
is( $sip_item->hold_patron_name, q{}, "SIP item with no hold returns empty string for patron name" ); |
113 |
|
114 |
my $resp .= C4::SIP::Sip::maybe_add( FID_CALL_NUMBER, $sip_item->hold_patron_name, $server ); |
115 |
is( $resp, q{}, "maybe_add returns empty string for SIP item with no hold returns empty string" ); |
116 |
|
117 |
$schema->storage->txn_rollback; |
118 |
}; |
119 |
|
85 |
subtest 'Lastseen response' => sub { |
120 |
subtest 'Lastseen response' => sub { |
86 |
|
121 |
|
87 |
my $schema = Koha::Database->new->schema; |
122 |
my $schema = Koha::Database->new->schema; |
88 |
- |
|
|