lame testsuite and the embarassing fixes in it found
authorivan <ivan>
Sun, 2 Sep 2001 04:25:55 +0000 (04:25 +0000)
committerivan <ivan>
Sun, 2 Sep 2001 04:25:55 +0000 (04:25 +0000)
44 files changed:
FS/FS.pm
FS/FS/cust_bill_pay.pm
FS/FS/cust_main.pm
FS/FS/cust_refund.pm
FS/MANIFEST
FS/t/CGI.t [new file with mode: 0644]
FS/t/CGIwrapper.t [new file with mode: 0644]
FS/t/Conf.t [new file with mode: 0644]
FS/t/Record.t [new file with mode: 0644]
FS/t/UID.t [new file with mode: 0644]
FS/t/agent.t [new file with mode: 0644]
FS/t/agent_type.t [new file with mode: 0644]
FS/t/cust_bill.t [new file with mode: 0644]
FS/t/cust_bill_pay.t [new file with mode: 0644]
FS/t/cust_bill_pkg.t [new file with mode: 0644]
FS/t/cust_credit.t [new file with mode: 0644]
FS/t/cust_credit_bill.t [new file with mode: 0644]
FS/t/cust_credit_refund.t [new file with mode: 0644]
FS/t/cust_main.t [new file with mode: 0644]
FS/t/cust_main_county.t [new file with mode: 0644]
FS/t/cust_main_invoice.t [new file with mode: 0644]
FS/t/cust_pay.t [new file with mode: 0644]
FS/t/cust_pay_batch.t [new file with mode: 0644]
FS/t/cust_pkg.t [new file with mode: 0644]
FS/t/cust_refund.t [new file with mode: 0644]
FS/t/cust_svc.t [new file with mode: 0644]
FS/t/domain_record.t [new file with mode: 0644]
FS/t/nas.t [new file with mode: 0644]
FS/t/part_pkg.t [new file with mode: 0644]
FS/t/part_referral.t [new file with mode: 0644]
FS/t/part_svc.t [new file with mode: 0644]
FS/t/pkg_svc.t [new file with mode: 0644]
FS/t/port.t [new file with mode: 0644]
FS/t/prepay_credit.t [new file with mode: 0644]
FS/t/session.t [new file with mode: 0644]
FS/t/svc_Common.t [new file with mode: 0644]
FS/t/svc_acct.t [new file with mode: 0644]
FS/t/svc_acct_pop.t [new file with mode: 0644]
FS/t/svc_acct_sm.t [new file with mode: 0644]
FS/t/svc_domain.t [new file with mode: 0644]
FS/t/svc_forward.t [new file with mode: 0644]
FS/t/svc_www.t [new file with mode: 0644]
FS/t/type_pkgs.t [new file with mode: 0644]
FS/test.pl [deleted file]

index ed61db4..652e458 100644 (file)
--- a/FS/FS.pm
+++ b/FS/FS.pm
@@ -81,10 +81,16 @@ L<FS::cust_bill_pkg> - Invoice line item class
 
 L<FS::cust_pay> - Payment class
 
+L<FS::cust_bill_pay> - Payment application class
+
 L<FS::cust_credit> - Credit class
 
 L<FS::cust_refund> - Refund class
 
+L<FS::cust_credit_refund> - Refund application class
+
+L<FS::cust_credit_bill> - Refund invoice application class
+
 L<FS::cust_pay_batch> - Credit card transaction queue class
 
 L<FS::prepay_credit> - Prepaid "calling card" credit class.
@@ -122,7 +128,7 @@ The main documentation is in htdocs/docs.
 
 =head1 VERSION
 
-$Id: FS.pm,v 1.5 2001-04-23 12:40:30 ivan Exp $
+$Id: FS.pm,v 1.6 2001-09-02 04:25:55 ivan Exp $
 
 =head1 SUPPORT
 
index a7e2831..fea6aee 100644 (file)
@@ -107,9 +107,9 @@ sub insert {
   };
 
   my $bill_total = 0;
-  $bill_total += foreach map { $_->amount }
+  $bill_total += $_ foreach map { $_->amount }
     qsearch('cust_bill_pay', { 'invnum' => $self->invnum } );
-  $bill_total += foreach map { $_->amount } 
+  $bill_total += $_ foreach map { $_->amount } 
     qsearch('cust_credit_bill', { 'invnum' => $self->invnum } );
   if ( $bill_total > $cust_bill->charged ) {
     $dbh->rollback if $oldAutoCommit;
@@ -194,7 +194,7 @@ sub cust_bill {
 
 =head1 VERSION
 
-$Id: cust_bill_pay.pm,v 1.4 2001-09-02 02:46:55 ivan Exp $
+$Id: cust_bill_pay.pm,v 1.5 2001-09-02 04:25:55 ivan Exp $
 
 =head1 BUGS
 
index c44c893..41ad21b 100644 (file)
@@ -1266,7 +1266,7 @@ sub apply_credits {
   foreach my $cust_bill ( @invoices ) {
     my $amount;
 
-    if (!(defined $credit) || $credit->credited == 0) {
+    if ( !defined($credit) || $credit->credited == 0) {
       $credit = pop @credits or last;
     }
 
@@ -1316,7 +1316,7 @@ sub apply_payments {
   foreach my $cust_bill ( @invoices ) {
     my $amount;
 
-    if ( !defined $payment || $payment->unapplied = 0 ) {
+    if ( !defined($payment) || $payment->unapplied == 0 ) {
       $payment = pop @payments or last;
     }
 
@@ -1501,7 +1501,7 @@ sub rebuild_fuzzyfiles {
 
 =head1 VERSION
 
-$Id: cust_main.pm,v 1.27 2001-09-02 02:46:55 ivan Exp $
+$Id: cust_main.pm,v 1.28 2001-09-02 04:25:55 ivan Exp $
 
 =head1 BUGS
 
index c216ec2..89f8f68 100644 (file)
@@ -103,7 +103,7 @@ sub insert {
       'amount'    => $self->refund,
       '_date'     => $self->_date,
     };
-    $error = $cust_bill_pay->insert;
+    $error = $cust_credit_refund->insert;
     if ( $error ) {
       $dbh->rollback if $oldAutoCommit;
       return $error;
@@ -198,7 +198,7 @@ sub check {
 
 =head1 VERSION
 
-$Id: cust_refund.pm,v 1.6 2001-09-02 02:46:55 ivan Exp $
+$Id: cust_refund.pm,v 1.7 2001-09-02 04:25:55 ivan Exp $
 
 =head1 BUGS
 
index f6b8abf..209c93a 100644 (file)
@@ -1,4 +1,11 @@
 Changes
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+README
+bin/freeside-bill
+bin/freeside-email
+bin/freeside-print-batch
 FS.pm
 FS/CGI.pm
 FS/Conf.pm
@@ -37,16 +44,46 @@ FS/type_pkgs.pm
 FS/nas.pm
 FS/port.pm
 FS/session.pm
-MANIFEST
-MANIFEST.SKIP
-Makefile.PL
-test.pl
-README
-bin/freeside-bill
-bin/freeside-email
-bin/freeside-print-batch
 FS/domain_record.pm
 FS/prepay_credit.pm
 FS/svc_www.pm
 FS/CGIwrapper.pm
 FS/svc_forward.pm
+t/agent.t
+t/agent_type.t
+t/CGI.t
+t/CGIwrapper.t
+t/Conf.t
+t/cust_bill.t
+t/cust_bill_pay.t
+t/cust_bill_pkg.t
+t/cust_credit.t
+t/cust_credit_bill.t
+t/cust_credit_refund.t
+t/cust_main.t
+t/cust_main_county.t
+t/cust_main_invoice.t
+t/cust_pay.t
+t/cust_pay_batch.t
+t/cust_pkg.t
+t/cust_refund.t
+t/cust_svc.t
+t/domain_record.t
+t/nas.t
+t/part_pkg.t
+t/part_referral.t
+t/part_svc.t
+t/pkg_svc.t
+t/port.t
+t/prepay_credit.t
+t/Record.t
+t/session.t
+t/svc_acct.t
+t/svc_acct_pop.t
+t/svc_acct_sm.t
+t/svc_Common.t
+t/svc_domain.t
+t/svc_forward.t
+t/svc_www.t
+t/type_pkgs.t
+t/UID.t
diff --git a/FS/t/CGI.t b/FS/t/CGI.t
new file mode 100644 (file)
index 0000000..1b4e238
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::CGI;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/CGIwrapper.t b/FS/t/CGIwrapper.t
new file mode 100644 (file)
index 0000000..06c741c
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::CGIwrapper;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/Conf.t b/FS/t/Conf.t
new file mode 100644 (file)
index 0000000..a9f7653
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::Conf;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/Record.t b/FS/t/Record.t
new file mode 100644 (file)
index 0000000..00de1ed
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::Record;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/UID.t b/FS/t/UID.t
new file mode 100644 (file)
index 0000000..9f7da4e
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::UID;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/agent.t b/FS/t/agent.t
new file mode 100644 (file)
index 0000000..769cce2
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::agent;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/agent_type.t b/FS/t/agent_type.t
new file mode 100644 (file)
index 0000000..99c66a1
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::agent_type;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill.t b/FS/t/cust_bill.t
new file mode 100644 (file)
index 0000000..b43f08e
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill_pay.t b/FS/t/cust_bill_pay.t
new file mode 100644 (file)
index 0000000..001eed0
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill_pay;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill_pkg.t b/FS/t/cust_bill_pkg.t
new file mode 100644 (file)
index 0000000..0e45bdb
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill_pkg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_credit.t b/FS/t/cust_credit.t
new file mode 100644 (file)
index 0000000..cddf75c
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_credit;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_credit_bill.t b/FS/t/cust_credit_bill.t
new file mode 100644 (file)
index 0000000..0ef54c3
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_credit_bill;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_credit_refund.t b/FS/t/cust_credit_refund.t
new file mode 100644 (file)
index 0000000..6b2b599
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_credit_refund;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_main.t b/FS/t/cust_main.t
new file mode 100644 (file)
index 0000000..b0ffbdb
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_main;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_main_county.t b/FS/t/cust_main_county.t
new file mode 100644 (file)
index 0000000..dd61199
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_main_county;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_main_invoice.t b/FS/t/cust_main_invoice.t
new file mode 100644 (file)
index 0000000..9661620
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_main_invoice;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_pay.t b/FS/t/cust_pay.t
new file mode 100644 (file)
index 0000000..f6d0b75
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_pay;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_pay_batch.t b/FS/t/cust_pay_batch.t
new file mode 100644 (file)
index 0000000..02b572c
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_pay_batch;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_pkg.t b/FS/t/cust_pkg.t
new file mode 100644 (file)
index 0000000..c6a6860
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_pkg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_refund.t b/FS/t/cust_refund.t
new file mode 100644 (file)
index 0000000..91583da
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_refund;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_svc.t b/FS/t/cust_svc.t
new file mode 100644 (file)
index 0000000..267d731
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_svc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/domain_record.t b/FS/t/domain_record.t
new file mode 100644 (file)
index 0000000..794518c
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::domain_record;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/nas.t b/FS/t/nas.t
new file mode 100644 (file)
index 0000000..6f8ae36
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::nas;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_pkg.t b/FS/t/part_pkg.t
new file mode 100644 (file)
index 0000000..fd96073
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_pkg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_referral.t b/FS/t/part_referral.t
new file mode 100644 (file)
index 0000000..d20b979
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_referral;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_svc.t b/FS/t/part_svc.t
new file mode 100644 (file)
index 0000000..bdb2a7a
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_svc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/pkg_svc.t b/FS/t/pkg_svc.t
new file mode 100644 (file)
index 0000000..77d3429
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::pkg_svc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/port.t b/FS/t/port.t
new file mode 100644 (file)
index 0000000..46377aa
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::port;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/prepay_credit.t b/FS/t/prepay_credit.t
new file mode 100644 (file)
index 0000000..e7626bd
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::prepay_credit;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/session.t b/FS/t/session.t
new file mode 100644 (file)
index 0000000..c4b714e
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::session;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_Common.t b/FS/t/svc_Common.t
new file mode 100644 (file)
index 0000000..ed49e1e
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_Common;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_acct.t b/FS/t/svc_acct.t
new file mode 100644 (file)
index 0000000..9ca78c9
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_acct;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_acct_pop.t b/FS/t/svc_acct_pop.t
new file mode 100644 (file)
index 0000000..e612c40
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_acct_pop;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_acct_sm.t b/FS/t/svc_acct_sm.t
new file mode 100644 (file)
index 0000000..1082f2c
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_acct_sm;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_domain.t b/FS/t/svc_domain.t
new file mode 100644 (file)
index 0000000..4d91898
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_domain;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_forward.t b/FS/t/svc_forward.t
new file mode 100644 (file)
index 0000000..d653d34
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_forward;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_www.t b/FS/t/svc_www.t
new file mode 100644 (file)
index 0000000..eb4e83f
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_www;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/type_pkgs.t b/FS/t/type_pkgs.t
new file mode 100644 (file)
index 0000000..9840180
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::type_pkgs;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/test.pl b/FS/test.pl
deleted file mode 100644 (file)
index dc37262..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl test.pl'
-
-######################### We start with some black magic to print on failure.
-
-# Change 1..1 below to 1..last_test_to_print .
-# (It may become useful if the test is moved to ./t subdirectory.)
-
-BEGIN { $| = 1; print "1..1\n"; }
-END {print "not ok 1\n" unless $loaded;}
-use FS;
-$loaded = 1;
-print "ok 1\n";
-
-######################### End of black magic.
-
-# Insert your test code below (better if it prints "ok 13"
-# (correspondingly "not ok 13") depending on the success of chunk 13
-# of the test code):
-