Koha/t/db_dependent/BackgroundJob.t
Robin Sheat 9df2a4a8fc Bug 5477 [SIGN-OFF] Fix test cases that require database access
This moves the DB-requiring tests out of the way, with the exception of
00-load.t which is used by the git hooks. For it, it makes it skip
loading problematic modules. This allows 'make test' to complete successfully
without a database configured, wich is a required part of making packages.

This has been tested against the v3.02.03 tag and the master branch.

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-29 17:02:31 +13:00

36 lines
821 B
Perl

#!/usr/bin/perl
#
# This Koha test module is a stub!
# Add more tests here!!!
use strict;
use warnings;
use C4::Auth;
use CGI;
use Test::More tests => 8;
BEGIN {
use_ok('C4::BackgroundJob');
}
my $query = new CGI;
my ($userid, $cookie, $sessionID) = &checkauth($query, 1);
#my ($sessionID, $job_name, $job_invoker, $num_work_units) = @_;
my $background;
diag $sessionID;
ok ($background=C4::BackgroundJob->new($sessionID));
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");