|
Lines 18-24
Link Here
|
| 18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
use Test::More tests => 74; |
21 |
use Test::More tests => 78; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
|
24 |
|
|
Lines 356-361
$prepared_letter = GetPreparedLetter((
Link Here
|
| 356 |
is( $prepared_letter->{content}, q|And also this one:| . output_pref({ dt => $yesterday_night }) . q|.|, 'dateonly test 3' ); |
356 |
is( $prepared_letter->{content}, q|And also this one:| . output_pref({ dt => $yesterday_night }) . q|.|, 'dateonly test 3' ); |
| 357 |
|
357 |
|
| 358 |
$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('claimacquisition','TESTACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>|<<aqcontacts.name>>|<order>Ordernumber <<aqorders.ordernumber>> (<<biblio.title>>) (<<aqorders.quantity>> ordered)</order>');}); |
358 |
$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('claimacquisition','TESTACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>|<<aqcontacts.name>>|<order>Ordernumber <<aqorders.ordernumber>> (<<biblio.title>>) (<<aqorders.quantity>> ordered)</order>');}); |
|
|
359 |
$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('orderacquisition','TESTACQORDER','Acquisition Order','Order','<<aqbooksellers.name>>|<<aqcontacts.name>>|<order>Ordernumber <<aqorders.ordernumber>> (<<biblio.title>>) (<<aqorders.quantity>> ordered)</order>');}); |
| 359 |
|
360 |
|
| 360 |
# Test that _parseletter doesn't modify its parameters bug 15429 |
361 |
# Test that _parseletter doesn't modify its parameters bug 15429 |
| 361 |
{ |
362 |
{ |
|
Lines 373-379
my $booksellerid = C4::Bookseller::AddBookseller(
Link Here
|
| 373 |
deliverytime => 5, |
374 |
deliverytime => 5, |
| 374 |
}, |
375 |
}, |
| 375 |
[ |
376 |
[ |
| 376 |
{ name => 'John Smith', phone => '0123456x1', claimacquisition => 1 }, |
377 |
{ name => 'John Smith', acqprimary => 1, phone => '0123456x1', claimacquisition => 1, orderacquisition => 1 }, |
| 377 |
{ name => 'Leo Tolstoy', phone => '0123456x2', claimissues => 1 }, |
378 |
{ name => 'Leo Tolstoy', phone => '0123456x2', claimissues => 1 }, |
| 378 |
] |
379 |
] |
| 379 |
); |
380 |
); |
|
Lines 424-429
t::lib::Mocks::mock_preference( 'LetterLog', 'on' );
Link Here
|
| 424 |
|
425 |
|
| 425 |
{ |
426 |
{ |
| 426 |
warning_is { |
427 |
warning_is { |
|
|
428 |
$err = SendAlerts( 'orderacquisition', $basketno , 'TESTACQORDER' ) } |
| 429 |
"Fake sendmail", |
| 430 |
"SendAlerts is using the mocked sendmail routine (orderacquisition)"; |
| 431 |
is($err, 1, "Successfully sent order."); |
| 432 |
is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent order"); |
| 433 |
is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Order notice text constructed successfully'); |
| 434 |
} |
| 435 |
|
| 436 |
|
| 437 |
{ |
| 438 |
warning_is { |
| 427 |
$err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) } |
439 |
$err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) } |
| 428 |
"Fake sendmail", |
440 |
"Fake sendmail", |
| 429 |
"SendAlerts is using the mocked sendmail routine"; |
441 |
"SendAlerts is using the mocked sendmail routine"; |
| 430 |
- |
|
|