From d297f4d2674b932922e2562834823e90d86c398c Mon Sep 17 00:00:00 2001 From: Sam Sanders Date: Tue, 17 Jan 2012 15:37:59 +1300 Subject: [PATCH] bug 5327 add tests for C4/BackgroundJob.pm Signed-off-by: Katrin Fischer perl t/db_dependent/BackgroundJob.t All tests complete successfully. Note: Test 11 does not tell what it's about, but it has been there before. (cherry picked from commit dbb29b4042f3e1785dff1ca5aaa351a6340a8183) Signed-off-by: Chris Nighswonger --- t/db_dependent/BackgroundJob.t | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/BackgroundJob.t b/t/db_dependent/BackgroundJob.t index 8106e02523..0afa3158c0 100644 --- a/t/db_dependent/BackgroundJob.t +++ b/t/db_dependent/BackgroundJob.t @@ -7,7 +7,7 @@ use strict; use warnings; use C4::Auth; use CGI; -use Test::More tests => 10; +use Test::More tests => 11; BEGIN { use_ok('C4::BackgroundJob'); @@ -17,8 +17,8 @@ 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); +ok ($background=C4::BackgroundJob->new($sessionID), "making job"); +ok ($background->id, "fetching id number"); $background->name("George"); is ($background->name, "George", "testing name"); @@ -29,12 +29,15 @@ is ($background->invoker, "enjoys", "testing invoker"); $background->progress("testing"); is ($background->progress, "testing", "testing progress"); -ok ($background->status); +ok ($background->status, "testing status"); $background->size("56"); is ($background->size, "56", "testing size"); +ok (!$background->fetch($sessionID, $background->id), "testing fetch"); + + $background->finish("finished"); is ($background->status,'completed', "testing finished"); -ok ($background->results); # Will return undef unless finished \ No newline at end of file +ok ($background->results); #Will return undef unless finished -- 2.39.5