# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
-use Test::More tests => 74;
+use Test::More tests => 78;
use Test::MockModule;
use Test::Warn;
is( $prepared_letter->{content}, q|And also this one:| . output_pref({ dt => $yesterday_night }) . q|.|, 'dateonly test 3' );
$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>');});
+$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>');});
# Test that _parseletter doesn't modify its parameters bug 15429
{
deliverytime => 5,
},
[
- { name => 'John Smith', phone => '0123456x1', claimacquisition => 1 },
+ { name => 'John Smith', acqprimary => 1, phone => '0123456x1', claimacquisition => 1, orderacquisition => 1 },
{ name => 'Leo Tolstoy', phone => '0123456x2', claimissues => 1 },
]
);
{
warning_is {
+ $err = SendAlerts( 'orderacquisition', $basketno , 'TESTACQORDER' ) }
+ "Fake sendmail",
+ "SendAlerts is using the mocked sendmail routine (orderacquisition)";
+is($err, 1, "Successfully sent order.");
+is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent order");
+is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Order notice text constructed successfully');
+}
+
+
+{
+warning_is {
$err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) }
"Fake sendmail",
"SendAlerts is using the mocked sendmail routine";