Bugzilla – Attachment 96895 Details for
Bug 21684
Koha::Object[s]->delete methods must behave identically as the corresponding DBIx::Class ones
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21684: (follow-up) Fix UploadedFile[s]->delete
Bug-21684-follow-up-Fix-UploadedFiles-delete.patch (text/plain), 2.19 KB, created by
Jonathan Druart
on 2020-01-07 14:24:44 UTC
(
hide
)
Description:
Bug 21684: (follow-up) Fix UploadedFile[s]->delete
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-07 14:24:44 UTC
Size:
2.19 KB
patch
obsolete
>From cafee6daa1a43fb2bb93993327f096c0019af71f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 7 Jan 2020 15:24:16 +0100 >Subject: [PATCH] Bug 21684: (follow-up) Fix UploadedFile[s]->delete > >This can be squashed >--- > t/db_dependent/Upload.t | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Upload.t b/t/db_dependent/Upload.t >index 93dc5f500f..23a50caa01 100644 >--- a/t/db_dependent/Upload.t >+++ b/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' ); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21684
:
81317
|
81318
|
81319
|
90937
|
96218
|
96254
|
96270
|
96271
|
96272
|
96429
|
96430
|
96431
|
96872
|
96888
| 96895 |
96898