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

(-)a/t/db_dependent/Circulation/MarkIssueReturned.t (-4 / +12 lines)
Lines 174-183 subtest 'Manually pass a return date' => sub { Link Here
174
174
175
    $issue = C4::Circulation::AddIssue( $patron->unblessed, $item->barcode );
175
    $issue = C4::Circulation::AddIssue( $patron->unblessed, $item->barcode );
176
176
177
    throws_ok
177
    {
178
        { $issue_id = C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item->itemnumber, 'bad_date', 0 ); }
178
        # Hiding the expected warning displayed by DBI
179
        'Koha::Exceptions::Object::BadValue',
179
        # DBD::mysql::st execute failed: Incorrect datetime value: 'bad_date' for column 'returndate'
180
        'An exception is thrown on bad date';
180
        my $stderr;
181
        local *STDERR;
182
        open STDERR, '>', '/dev/null';
183
        throws_ok
184
            { $issue_id = C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item->itemnumber, 'bad_date', 0 ); }
185
            'Koha::Exceptions::Object::BadValue',
186
            'An exception is thrown on bad date';
187
        close STDERR;
188
    }
181
189
182
    $schema->storage->txn_rollback;
190
    $schema->storage->txn_rollback;
183
};
191
};
(-)a/t/db_dependent/Suggestions.t (-7 / +16 lines)
Lines 250-261 $messages = C4::Letters::GetQueuedMessages({ Link Here
250
});
250
});
251
is ($messages->[0]->{message_transport_type}, 'email', 'When FallbackToSMSIfNoEmail syspref is enabled the suggestion message_transport_type is email if the borrower has an email');
251
is ($messages->[0]->{message_transport_type}, 'email', 'When FallbackToSMSIfNoEmail syspref is enabled the suggestion message_transport_type is email if the borrower has an email');
252
252
253
$mod_suggestion4->{manageddate} = 'invalid date!';
253
{
254
ModSuggestion($mod_suggestion4);
254
    # Hiding the expected warning displayed by DBI
255
$messages = C4::Letters::GetQueuedMessages({
255
    # DBD::mysql::st execute failed: Incorrect date value: 'invalid date!' for column 'manageddate'
256
    borrowernumber => $borrowernumber2
256
    my $stderr;
257
});
257
    local *STDERR;
258
is (scalar(@$messages), 1, 'No new letter should have been generated if the update raised an error');
258
    open STDERR, '>', '/dev/null';
259
260
    $mod_suggestion4->{manageddate} = 'invalid date!';
261
    ModSuggestion($mod_suggestion4);
262
    $messages = C4::Letters::GetQueuedMessages({
263
        borrowernumber => $borrowernumber2
264
    });
265
266
    close STDERR;
267
    is (scalar(@$messages), 1, 'No new letter should have been generated if the update raised an error');
268
}
259
269
260
is( GetSuggestionInfo(), undef, 'GetSuggestionInfo without the suggestion id returns undef' );
270
is( GetSuggestionInfo(), undef, 'GetSuggestionInfo without the suggestion id returns undef' );
261
$suggestion = GetSuggestionInfo($my_suggestionid);
271
$suggestion = GetSuggestionInfo($my_suggestionid);
262
- 

Return to bug 23038