Rework build_subs(), thanks to Michal Schwern, closes: CPAN#22073
[Business-OnlinePayment.git] / t / override.t
1 #!/usr/bin/perl -w
2
3 use Test::More tests => 2;
4
5 {    # fake test driver (with submit method)
6
7     package Business::OnlinePayment::MOCK;
8     use strict;
9     use warnings;
10     use base qw(Business::OnlinePayment);
11     sub test_transaction {
12         my $self = shift;
13         return $self->SUPER::test_transaction(@_);
14     }
15 }
16
17 $INC{"Business/OnlinePayment/MOCK.pm"} = "testing";
18
19 my $tx = Business::OnlinePayment->new("MOCK");
20 is eval {
21     $tx->test_transaction(1);
22     $tx->test_transaction;
23 }, 1;
24 is $@, '';