@@ -, +, @@ --- t/db_dependent/BackgroundJob.t | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) --- a/t/db_dependent/BackgroundJob.t +++ a/t/db_dependent/BackgroundJob.t @@ -50,10 +50,8 @@ is( $job->status, 'completed', "testing finished" ); ok( $job->results ); #Will return undef unless finished my $second_job = C4::BackgroundJob->new( $sessionID, "making new job" ); -$session = C4::Auth::get_session( $job->{sessionID} ); -is( ref( $session->param( 'job_' . $job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 1' ); -is( ref( $session->param( 'job_' . $second_job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 2' ); +is( ref( C4::BackgroundJob->fetch( $sessionID, $job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 1' ); +is( ref( C4::BackgroundJob->fetch( $sessionID, $second_job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 2' ); $job->clear; -$session = C4::Auth::get_session( $job->{sessionID} ); -is( $session->param( 'job_' . $job->id ), undef, 'After clearing it, job 1 should not exist anymore in the session' ); -is( ref( $session->param( 'job_' . $second_job->id ) ), "C4::BackgroundJob", 'After clear on job 1, job 2 should still be a C4::BackgroundJob' ); +is( C4::BackgroundJob->fetch( $sessionID, $job->id ), undef, 'After clearing it, job 1 should not exist anymore in the session' ); +is( ref( C4::BackgroundJob->fetch( $sessionID, $second_job->id ) ), "C4::BackgroundJob", 'After clear on job 1, job 2 should still be a C4::BackgroundJob' ); --