Bug 39337: (follow-up) Mock OpacSuppression in Output tests
Before the refactoring in this bug, redirect_if_opac_suppressed was intended to be called after checking OpacSuppression was enabled. Now it performs this check internally, so to adapt these unit tests correspondingly, we mock OpacSuppression to be enabled, as was the implied state before. Test plan: 1. Prove t/db_dependent/Output.t and verify all tests pass. Sponsored-by: Open Fifth Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
bb05ef7ce8
commit
0ae6c196ec
|
|
@ -63,6 +63,8 @@ subtest 'redirect_if_opac_suppressed() tests' => sub {
|
|||
|
||||
plan tests => 1;
|
||||
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppression', 1 );
|
||||
|
||||
open STDOUT, '>', \$stdout;
|
||||
$opac_suppressed = 0;
|
||||
|
||||
|
|
@ -81,6 +83,7 @@ subtest 'redirect_if_opac_suppressed() tests' => sub {
|
|||
|
||||
{
|
||||
open STDOUT, '>', \$stdout;
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppression', 1 );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionByIPRange', undef );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionRedirect', 1 );
|
||||
|
||||
|
|
@ -100,6 +103,7 @@ subtest 'redirect_if_opac_suppressed() tests' => sub {
|
|||
|
||||
{
|
||||
open STDOUT, '>', \$stdout;
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppression', 1 );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionByIPRange', undef );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionRedirect', 0 );
|
||||
|
||||
|
|
@ -121,6 +125,7 @@ subtest 'redirect_if_opac_suppressed() tests' => sub {
|
|||
{
|
||||
open STDOUT, '>', \$stdout;
|
||||
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppression', 1 );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionByIPRange', '192.168' );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionRedirect', 0 );
|
||||
|
||||
|
|
@ -143,6 +148,7 @@ subtest 'redirect_if_opac_suppressed() tests' => sub {
|
|||
{
|
||||
open STDOUT, '>', \$stdout;
|
||||
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppression', 1 );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionByIPRange', '192.168' );
|
||||
t::lib::Mocks::mock_preference( 'OpacSuppressionRedirect', 0 );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue