Merge remote branch 'kc/new/bug_5327' into kcmaster
authorChris Cormack <chrisc@catalyst.net.nz>
Mon, 17 Jan 2011 23:01:04 +0000 (12:01 +1300)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 17 Jan 2011 23:01:04 +0000 (12:01 +1300)
t/BackgroundJob.t [new file with mode: 0644]
t/Debug.t

diff --git a/t/BackgroundJob.t b/t/BackgroundJob.t
new file mode 100644 (file)
index 0000000..faee9c1
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 8;
+
+BEGIN {
+        use_ok('C4::BackgroundJob');
+}
+
+#my ($sessionID, $job_name, $job_invoker, $num_work_units) = @_;
+my $background;
+ok ($background=C4::BackgroundJob->new);
+ok ($background->id);
+
+$background->name("George");
+is ($background->name, "George", "testing name");
+
+$background->invoker("enjoys");
+is ($background->invoker, "enjoys", "testing invoker");
+
+$background->progress("testing");
+is ($background->progress, "testing", "testing progress");
+
+ok ($background->status);
+
+$background->size("56");
+is ($background->size, "56", "testing size");
+
index 967229c..54ef5c6 100755 (executable)
--- a/t/Debug.t
+++ b/t/Debug.t
@@ -3,11 +3,13 @@
 use strict;
 use warnings;
 
-use Test::More tests => 3;
+use Test::More tests => 5;
 
 use vars qw($debug $cgi_debug);
 
 BEGIN {
+$ENV{'KOHA_CGI_DEBUG'}='2';
+$ENV{'KOHA_DEBUG'}='5';
        diag "BEFORE use:     \$debug is " . (defined     $debug ?     $debug : 'not defined');
        diag "BEFORE use: \$cgi_debug is " . (defined $cgi_debug ? $cgi_debug : 'not defined');
        use_ok('C4::Debug');
@@ -17,5 +19,7 @@ diag " AFTER use:     \$debug is " . (defined     $debug ?     $debug : 'not def
 diag " AFTER use: \$cgi_debug is " . (defined $cgi_debug ? $cgi_debug : 'not defined');
 ok(defined     $debug, "    \$debug defined and imported.");
 ok(defined $cgi_debug, "\$cgi_debug defined and imported.");
+is($cgi_debug,2,"cgi_debug gets the ENV{'KOHA_CGI_DEBUG'}");
+is($debug,5,"debug gets the ENV{'KOHA_DEBUG'}");
 
 diag "Done.";