Lines 834-845
subtest 'Userenv clearing in check_cookie_auth' => sub {
Link Here
|
834 |
}; |
834 |
}; |
835 |
|
835 |
|
836 |
subtest 'create_basic_session tests' => sub { |
836 |
subtest 'create_basic_session tests' => sub { |
837 |
plan tests => 12; |
837 |
plan tests => 13; |
838 |
|
838 |
|
839 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
839 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
840 |
my $interface = 'opac'; |
|
|
841 |
|
840 |
|
842 |
my $session = C4::Auth::create_basic_session({ patron => $patron, interface => $interface }); |
841 |
my $session = C4::Auth::create_basic_session({ patron => $patron, interface => 'opac' }); |
843 |
|
842 |
|
844 |
isnt($session->id, undef, 'A new sessionID was created'); |
843 |
isnt($session->id, undef, 'A new sessionID was created'); |
845 |
is( $session->param('number'), $patron->borrowernumber, 'Session parameter number matches' ); |
844 |
is( $session->param('number'), $patron->borrowernumber, 'Session parameter number matches' ); |
Lines 852-858
subtest 'create_basic_session tests' => sub {
Link Here
|
852 |
is( $session->param('flags'), $patron->flags, 'Session parameter flags matches' ); |
851 |
is( $session->param('flags'), $patron->flags, 'Session parameter flags matches' ); |
853 |
is( $session->param('emailaddress'), $patron->email, 'Session parameter emailaddress matches' ); |
852 |
is( $session->param('emailaddress'), $patron->email, 'Session parameter emailaddress matches' ); |
854 |
is( $session->param('ip'), $session->remote_addr(), 'Session parameter ip matches' ); |
853 |
is( $session->param('ip'), $session->remote_addr(), 'Session parameter ip matches' ); |
855 |
is( $session->param('interface'), $interface, 'Session parameter interface matches' ); |
854 |
is( $session->param('interface'), 'opac', 'Session parameter interface matches' ); |
|
|
855 |
|
856 |
$session = C4::Auth::create_basic_session({ patron => $patron, interface => 'staff' }); |
857 |
is( $session->param('interface'), 'intranet', 'Staff interface gets converted to intranet' ); |
856 |
}; |
858 |
}; |
857 |
|
859 |
|
858 |
$schema->storage->txn_rollback; |
860 |
$schema->storage->txn_rollback; |
859 |
- |
|
|