From: fbriere Date: Mon, 8 May 2006 20:33:23 +0000 (+0000) Subject: Added idempotence test for to_xml() X-Git-Tag: V0_03~2 X-Git-Url: http://git.freeside.biz/gitweb/?p=Business-OnlinePayment-InternetSecure.git;a=commitdiff_plain;h=4faf9840f9ecf50c9cfa88bf236ab6963f101472 Added idempotence test for to_xml() --- diff --git a/t/50idempotence.t b/t/50idempotence.t new file mode 100755 index 0000000..a387e57 --- /dev/null +++ b/t/50idempotence.t @@ -0,0 +1,28 @@ +# vim:set syntax=perl encoding=utf-8: + +# get_remap_fields() used to be destructive (via remap_fields), and thus +# to_xml couldn't be called by itself. + +use Test::More tests => 1 + 1; + +BEGIN { use_ok('Business::OnlinePayment') }; + +use constant TRANSACTION => + ( + action => 'Normal Authorization', + + card_number => '5111-1111-1111-1111', + exp_date => '0704', + + name => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re", + + amount => 13.95, + ); + + +my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000'; + +$txn->content(TRANSACTION); + +is($txn->to_xml, $txn->to_xml, 'idempotence'); +