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)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 23 Jun 2014 18:07:21 +0000 (15:07 -0300)
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>
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 {