@@ -, +, @@ --- t/db_dependent/Upload.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/t/db_dependent/Upload.t +++ a/t/db_dependent/Upload.t @@ -206,7 +206,7 @@ subtest 'Test delete_missing' => sub { is( $deleted, 2, 'Expect two records with missing files' ); isnt( Koha::UploadedFiles->find( $upload01->{id} ), undef, 'Not deleted' ); $deleted = Koha::UploadedFiles->delete_missing; - ok( $deleted =~ /^(2|-1)$/, 'Deleted two records with missing files' ); + ok( $deleted =~ /^(2)$/, 'Deleted two records with missing files' ); is( Koha::UploadedFiles->search({ id => [ $upload01->{id}, $upload02->{id} ], })->count, 0, 'Records are gone' ); @@ -303,17 +303,17 @@ subtest 'Testing delete_temporary' => sub { # Now call delete_temporary with 6, 5 and 0 t::lib::Mocks::mock_preference('UploadPurgeTemporaryFilesDays', 6 ); my $delete = Koha::UploadedFiles->delete_temporary; - ok( $delete =~ /^(-1|0E0)$/, 'Check return value with 6' ); + is( $delete, '0E0', 'Check return value with 6' ); is( Koha::UploadedFiles->search->count, 6, 'Delete with pref==6' ); # use override parameter $delete = Koha::UploadedFiles->delete_temporary({ override_pref => 5 }); - ok( $delete =~ /^(2|-1)$/, 'Check return value with 5' ); + is( $delete, 2, 'Check return value with 5' ); is( Koha::UploadedFiles->search->count, 4, 'Delete with override==5' ); t::lib::Mocks::mock_preference('UploadPurgeTemporaryFilesDays', 0 ); $delete = Koha::UploadedFiles->delete_temporary; - ok( $delete =~ /^(-1|1)$/, 'Check return value with 0' ); + is( $delete, 1, 'Check return value with 0' ); is( Koha::UploadedFiles->search->count, 3, 'Delete with pref==0 makes 3' ); is( Koha::UploadedFiles->search({ permanent => 1 })->count, 3, 'Still 3 permanent uploads' ); --