View | Details | Raw Unified | Return to bug 13972
Collapse All | Expand All

(-)a/t/db_dependent/Letters.t (-2 / +42 lines)
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 => 58;
21
use Test::More tests => 62;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
24
Lines 336-341 $bookseller->contacts->[0]->email('testemail@mydomain.com'); Link Here
336
C4::Bookseller::ModBookseller($bookseller);
336
C4::Bookseller::ModBookseller($bookseller);
337
$bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
337
$bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
338
338
339
{
339
warning_is {
340
warning_is {
340
    $err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) }
341
    $err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) }
341
    "Fake sendmail",
342
    "Fake sendmail",
Lines 344-348 warning_is { Link Here
344
is($err, 1, "Successfully sent claim");
345
is($err, 1, "Successfully sent claim");
345
is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent claim");
346
is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent claim");
346
is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Claim notice text constructed successfully');
347
is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Claim notice text constructed successfully');
348
}
349
350
{
351
use C4::Serials;
352
353
my $notes = 'notes';
354
my $internalnotes = 'intnotes';
355
my $subscriptionid = NewSubscription(
356
     undef,      "",     undef, undef, undef, $biblionumber,
357
    '2013-01-01', 1, undef, undef,  undef,
358
    undef,      undef,  undef, undef, undef, undef,
359
    1,          $notes,undef, '2013-01-01', undef, 1,
360
    undef,       undef,  0,    $internalnotes,  0,
361
    undef, undef, 0,          undef,         '2013-12-31', 0
362
);
363
$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>>');});
364
my ($serials_count, @serials) = GetSerials($subscriptionid);
365
my $serial = $serials[0];
366
367
my $borrowernumber = AddMember(
368
    firstname    => 'John',
369
    surname      => 'Smith',
370
    categorycode => 'PT',
371
    branchcode   => 'CPL',
372
    dateofbirth  => $date,
373
    email        => 'john.smith@test.de',
374
);
375
my $alert_id = C4::Letters::addalert($borrowernumber, 'issue', $subscriptionid);
376
377
378
my $err2;
379
warning_is {
380
$err2 = SendAlerts( 'issue', $serial->{serialid}, 'RLIST' ) }
381
    "Fake sendmail",
382
    "SendAlerts is using the mocked sendmail routine";
383
is($err2, "", "Successfully sent serial notification");
384
is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification");
385
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully');
386
}
387
347
388
348
$schema->storage->txn_rollback();
389
$schema->storage->txn_rollback();
349
- 

Return to bug 13972