From 14bbccfcaa2026df508e4e40035dc636a11cb6a2 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 11 Mar 2015 15:10:53 -0300 Subject: [PATCH] Bug 11430: (QA followup) we test for warnings, always Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Search/History.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Search/History.t b/t/db_dependent/Search/History.t index 5cd0c77..68fde9d 100644 --- a/t/db_dependent/Search/History.t +++ b/t/db_dependent/Search/History.t @@ -2,7 +2,8 @@ use Modern::Perl; -use Test::More tests => 18; +use Test::More tests => 19; +use Test::Warn; use URI::Escape; use List::Util qw( shuffle ); @@ -123,7 +124,10 @@ is( scalar(@$all), 0, 'There are 0 search after deleting all searches for a user delete_all( $userid ); add( $userid, $current_sessionid, $previous_sessionid, $total, $query_cgi_b, $query_cgi_a ); -C4::Search::History::delete({}); +warning_like { C4::Search::History::delete({}) } + qr/^ERROR: userid or id is required for history deletion/, + 'Calling delete without userid raises warning' + ; $all = C4::Search::History::get({userid => $userid}); is( scalar(@$all), 9, 'There are still 9 searches after calling delete without userid' ); delete_all( $userid ); -- 2.3.2