Added idempotence test for to_xml()
authorfbriere <fbriere>
Mon, 8 May 2006 20:33:23 +0000 (20:33 +0000)
committerfbriere <fbriere>
Mon, 8 May 2006 20:33:23 +0000 (20:33 +0000)
t/50idempotence.t [new file with mode: 0755]

diff --git a/t/50idempotence.t b/t/50idempotence.t
new file mode 100755 (executable)
index 0000000..a387e57
--- /dev/null
@@ -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');
+