Line 0
Link Here
|
|
|
1 |
#!/usr/bin/perl |
2 |
|
3 |
# Tests for SIP::ILS::Transaction |
4 |
# Current state is very rudimentary. Please help to extend it! |
5 |
|
6 |
use Modern::Perl; |
7 |
use Test::More tests => 3; |
8 |
|
9 |
use Koha::Database; |
10 |
use t::lib::TestBuilder; |
11 |
use C4::SIP::ILS::Patron; |
12 |
use C4::SIP::ILS::Transaction::RenewAll; |
13 |
|
14 |
my $schema = Koha::Database->new->schema; |
15 |
$schema->storage->txn_begin; |
16 |
|
17 |
my $builder = t::lib::TestBuilder->new(); |
18 |
my $borr1 = $builder->build({ source => 'Borrower' }); |
19 |
my $card = $borr1->{cardnumber}; |
20 |
my $sip_patron = C4::SIP::ILS::Patron->new( $card ); |
21 |
|
22 |
# Create transaction RenewAll, assign patron, and run (no items) |
23 |
my $transaction = C4::SIP::ILS::Transaction::RenewAll->new(); |
24 |
is( ref $transaction, "C4::SIP::ILS::Transaction::RenewAll", "New transaction created" ); |
25 |
is( $transaction->patron( $sip_patron ), $sip_patron, "Patron assigned to transaction" ); |
26 |
isnt( $transaction->do_renew_all, undef, "RenewAll on zero items" ); |
27 |
|
28 |
$schema->storage->txn_rollback; |