View | Details | Raw Unified | Return to bug 31598
Collapse All | Expand All

(-)a/t/db_dependent/Upload.t (-4 / +3 lines)
Lines 175-185 subtest 'Test delete via UploadedFile as well as UploadedFiles' => sub { Link Here
175
    isnt( -e $path, 1, 'File no longer found after delete' );
175
    isnt( -e $path, 1, 'File no longer found after delete' );
176
176
177
    # add another record with TestBuilder, so file does not exist
177
    # add another record with TestBuilder, so file does not exist
178
    # catch warning
178
    # catch warning (which occurs when deleting permanent file)
179
    my $upload01 = $builder->build({ source => 'UploadedFile' });
179
    my $upload01 = $builder->build({ source => 'UploadedFile', value => { permanent => 1 } });
180
    warning_like { $delete = Koha::UploadedFiles->find( $upload01->{id} )->delete; }
180
    warning_like { $delete = Koha::UploadedFiles->find( $upload01->{id} )->delete; }
181
        qr/file was missing/,
181
        qr/file was missing/,
182
        'delete warns when file is missing';
182
        'delete warns when permanent file is missing';
183
    ok( $delete, 'Deleting record was successful' );
183
    ok( $delete, 'Deleting record was successful' );
184
    is( Koha::UploadedFiles->count, 4, 'Back to four uploads now' );
184
    is( Koha::UploadedFiles->count, 4, 'Back to four uploads now' );
185
185
186
- 

Return to bug 31598