From 7a20d157a6c2ddce51372c78f0d46c4f491d6d82 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Mon, 4 May 2015 20:37:58 -0400 Subject: [PATCH] Bug 14111 - More t/Auth_with_shibboleth.t silencing TEST PLAN --------- 1) Apply first patch 2) prove t/Auth_with_shibboleth.t -- failed?! 3) apply this patch 4) prove t/Auth_with_shibboleth.t -- success. *whew* 5) koha-qa test tools. --- t/Auth_with_shibboleth.t | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/t/Auth_with_shibboleth.t b/t/Auth_with_shibboleth.t index 1dcbf92..a92732d 100644 --- a/t/Auth_with_shibboleth.t +++ b/t/Auth_with_shibboleth.t @@ -28,7 +28,7 @@ use C4::Context; BEGIN { if ( check_install( module => 'Test::DBIx::Class' ) ) { - plan tests => 6; + plan tests => 11; } else { plan skip_all => "Need Test::DBIx::Class" } @@ -245,5 +245,22 @@ subtest "checkpw_shib tests" => sub { is( C4::Auth_with_shibboleth::_get_uri(), "https://testopac.com", "https opac uri returned" ); +$OPACBaseURL = "http://testopac.com"; +my $result; +warning_like { $result = C4::Auth_with_shibboleth::_get_uri() } + [ qr/Shibboleth requires OPACBaseURL to use the https protocol!/ ], + "improper protocol - received expected warning"; +is( $result, "https://testopac.com", "https opac uri returned" ); + +$OPACBaseURL = "https://testopac.com"; +is( C4::Auth_with_shibboleth::_get_uri(), + "https://testopac.com", "https opac uri returned" ); + +$OPACBaseURL = undef; +warning_like { $result = C4::Auth_with_shibboleth::_get_uri() } + [ qr/OPACBaseURL not set!/ ], + "undefined OPACBaseURL - received expected warning"; +is( $result, "https://", "https opac uri returned" ); + ## _get_shib_config # Internal helper function, covered in tests above -- 2.1.4