use Modern::Perl;
+$| = 1;
use Module::Load::Conditional qw/check_install/;
use Test::More;
use Test::MockModule;
BEGIN {
if ( check_install( module => 'Test::DBIx::Class' ) ) {
- plan tests => 9;
+ plan tests => 11;
} else {
plan skip_all => "Need Test::DBIx::Class"
}
is( $login, "test1234",
"good config with debug enabled, attribute value returned" );
-# bad config - with shib_ok implimented, we should never reach this sub with a bad config
+# bad config - with shib_ok implemented, we should never reach this sub with a bad config
};
## checkpw_shib
warnings_exist {
( $retval, $retcard, $retuserid ) = checkpw_shib( $shib_login );
}
- [ qr/checkpw_shib/, qr/User Shibboleth-authenticated as:/ ],
+ [ qr/checkpw_shib/, qr/koha borrower field to match: userid/,
+ qr/shibboleth attribute to match: uid/,
+ qr/User Shibboleth-authenticated as:/ ],
"good user with debug enabled";
is( $retval, "1", "user authenticated" );
is( $retcard, "testcardnumber", "expected cardnumber returned" );
}
[
qr/checkpw_shib/,
+ qr/koha borrower field to match: userid/,
+ qr/shibboleth attribute to match: uid/,
qr/User Shibboleth-authenticated as:/,
qr/not a valid Koha user/
],
$OPACBaseURL = "http://testopac.com";
my $result;
-warnings_are { $result = C4::Auth_with_shibboleth::_get_uri() }
- [ { carped =>
- 'Shibboleth requires OPACBaseURL to use the https protocol!' },
- ],
+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" );
"https://testopac.com", "https opac uri returned" );
$OPACBaseURL = undef;
-warnings_are { $result = C4::Auth_with_shibboleth::_get_uri() }
- [ { carped => 'OPACBaseURL not set!' },
- ],
+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" );