|
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 => 61; |
21 |
use Test::More tests => 65; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
|
24 |
|
|
Lines 351-356
$bookseller->contacts->[0]->email('testemail@mydomain.com');
Link Here
|
| 351 |
C4::Bookseller::ModBookseller($bookseller); |
351 |
C4::Bookseller::ModBookseller($bookseller); |
| 352 |
$bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); |
352 |
$bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); |
| 353 |
|
353 |
|
|
|
354 |
{ |
| 354 |
warning_is { |
355 |
warning_is { |
| 355 |
$err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) } |
356 |
$err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) } |
| 356 |
"Fake sendmail", |
357 |
"Fake sendmail", |
|
Lines 359-363
warning_is {
Link Here
|
| 359 |
is($err, 1, "Successfully sent claim"); |
360 |
is($err, 1, "Successfully sent claim"); |
| 360 |
is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent claim"); |
361 |
is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent claim"); |
| 361 |
is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Claim notice text constructed successfully'); |
362 |
is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Claim notice text constructed successfully'); |
|
|
363 |
} |
| 364 |
|
| 365 |
{ |
| 366 |
use C4::Serials; |
| 367 |
|
| 368 |
my $notes = 'notes'; |
| 369 |
my $internalnotes = 'intnotes'; |
| 370 |
my $subscriptionid = NewSubscription( |
| 371 |
undef, "", undef, undef, undef, $biblionumber, |
| 372 |
'2013-01-01', 1, undef, undef, undef, |
| 373 |
undef, undef, undef, undef, undef, undef, |
| 374 |
1, $notes,undef, '2013-01-01', undef, 1, |
| 375 |
undef, undef, 0, $internalnotes, 0, |
| 376 |
undef, undef, 0, undef, '2013-12-31', 0 |
| 377 |
); |
| 378 |
$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('serial','RLIST','Serial issue notification','Serial issue notification','<<biblio.title>>,<<subscription.subscriptionid>>,<<serial.serialseq>>');}); |
| 379 |
my ($serials_count, @serials) = GetSerials($subscriptionid); |
| 380 |
my $serial = $serials[0]; |
| 381 |
|
| 382 |
my $borrowernumber = AddMember( |
| 383 |
firstname => 'John', |
| 384 |
surname => 'Smith', |
| 385 |
categorycode => 'PT', |
| 386 |
branchcode => 'CPL', |
| 387 |
dateofbirth => $date, |
| 388 |
email => 'john.smith@test.de', |
| 389 |
); |
| 390 |
my $alert_id = C4::Letters::addalert($borrowernumber, 'issue', $subscriptionid); |
| 391 |
|
| 392 |
|
| 393 |
my $err2; |
| 394 |
warning_is { |
| 395 |
$err2 = SendAlerts( 'issue', $serial->{serialid}, 'RLIST' ) } |
| 396 |
"Fake sendmail", |
| 397 |
"SendAlerts is using the mocked sendmail routine"; |
| 398 |
is($err2, "", "Successfully sent serial notification"); |
| 399 |
is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification"); |
| 400 |
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully'); |
| 401 |
} |
| 402 |
|
| 362 |
|
403 |
|
| 363 |
$schema->storage->txn_rollback(); |
404 |
$schema->storage->txn_rollback(); |
| 364 |
- |
|
|