3 # Tests for SIP::ILS::Transaction
4 # Current state is very rudimentary. Please help to extend it!
7 use Test::More tests => 3;
10 use t::lib::TestBuilder;
11 use C4::SIP::ILS::Patron;
12 use C4::SIP::ILS::Transaction::RenewAll;
14 my $schema = Koha::Database->new->schema;
15 $schema->storage->txn_begin;
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 );
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" );
28 $schema->storage->txn_rollback;