Bug 12086: qa-followup: remove warning on launching unit tests
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 23 Jun 2014 09:43:48 +0000 (11:43 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 15 Dec 2014 16:29:40 +0000 (17:29 +0100)
Without this patch, the following warning appears:
  t/db_dependent/Holds/RevertWaitingStatus.t .. Subroutine
  C4::Context::userenv redefined at
  t/db_dependent/Holds/RevertWaitingStatus.t line 25.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8e1b6f76d60efd4b7806788ec44c73348dcbdd51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

t/db_dependent/Holds/RevertWaitingStatus.t

index 4adde49..7b43edd 100755 (executable)
@@ -22,6 +22,7 @@ $dbh->{RaiseError} = 1;
 $dbh->do("DELETE FROM reserves");
 $dbh->do("DELETE FROM old_reserves");
 
+local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ };
 *C4::Context::userenv = \&Mock_userenv;
 
 sub Mock_userenv {