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

Return to bug 13972