From 9bafaade197b3a839117504831e27224a2d87414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 10 Apr 2015 15:19:45 +0200 Subject: [PATCH] Bug 13606 New test for added method to C4::BackgroundJob --- t/db_dependent/BackgroundJob.t | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/BackgroundJob.t b/t/db_dependent/BackgroundJob.t index 9ea2caa..64216ad 100644 --- a/t/db_dependent/BackgroundJob.t +++ b/t/db_dependent/BackgroundJob.t @@ -3,17 +3,23 @@ # This Koha test module is a stub! # Add more tests here!!! -use strict; -use warnings; -use C4::Auth; +use Modern::Perl; use CGI qw ( -utf8 ); -use Test::More tests => 14; +use Test::More tests => 15; BEGIN { use_ok('C4::BackgroundJob'); } + +# we need a session cookie my $query = new CGI; -my ($userid, $cookie, $sessionID) = &checkauth($query, 1); +my ($userid, $sessionID) = ('frederic', '1234'); +my $cookie = $query->cookie( + -name => 'CGISESSID', + -value => 'test_background_job', + -HttpOnly => 1 +); + #my ($sessionID, $job_name, $job_invoker, $num_work_units) = @_; my $background; diag $sessionID; @@ -46,4 +52,7 @@ is ($background->size, "56", '->set() does not scribble over private object data $background->finish("finished"); is ($background->status,'completed', "testing finished"); -ok ($background->results); #Will return undef unless finished +ok ($background->results, "valid result"); #Will return undef unless finished + +can_ok($background, 'clear'); +$background->clear(); -- 2.3.5