Bugzilla – Attachment 61167 Details for
Bug 18275
opac-memberentry.pl security vulnerabilities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18275: Regression test
Bug-18275-Regression-test.patch (text/plain), 1.96 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-03-16 12:26:03 UTC
(
hide
)
Description:
Bug 18275: Regression test
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-03-16 12:26:03 UTC
Size:
1.96 KB
patch
obsolete
>From fe81989775f1ea7ac15c1c062ed74ea13eed2237 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 16 Mar 2017 09:23:24 -0300 >Subject: [PATCH] Bug 18275: Regression test > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Auth.t | 29 ++++++++++++++++++++++++++--- > 1 file changed, 26 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index 233b2beba2..7578420ac9 100644 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -6,9 +6,11 @@ > use Modern::Perl; > > use CGI qw ( -utf8 ); >+ >+use Test::MockObject; > use Test::MockModule; > use List::MoreUtils qw/all any none/; >-use Test::More tests => 20; >+use Test::More tests => 21; > use Test::Warn; > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -23,11 +25,30 @@ BEGIN { > use_ok('C4::Auth'); > } > >-my $schema = Koha::Database->schema; >-$schema->storage->txn_begin; >+my $schema = Koha::Database->schema; > my $builder = t::lib::TestBuilder->new; > my $dbh = C4::Context->dbh; > >+$schema->storage->txn_begin; >+ >+subtest 'checkauth() tests' => sub { >+ >+ plan tests => 1; >+ >+ my $patron = $builder->build({ source => 'Borrower', value => { flags => undef } })->{userid}; >+ >+ # Mock a CGI object with real userid param >+ my $cgi = Test::MockObject->new(); >+ $cgi->mock( 'param', sub { return $patron; } ); >+ $cgi->mock( 'cookie', sub { return; } ); >+ >+ my $authnotrequired = 1; >+ my ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, $authnotrequired ); >+ >+ is( $userid, undef, 'checkauth() returns undef for userid if no logged in user (Bug 18275)' ); >+ >+}; >+ > my $hash1 = hash_password('password'); > my $hash2 = hash_password('password'); > >@@ -198,3 +219,5 @@ ok( ( any { 'OPACBaseURL' eq $_ } keys %{$template2->{VARS}} ), > > ok(C4::Auth::checkpw_hash('password', $hash1), 'password validates with first hash'); > ok(C4::Auth::checkpw_hash('password', $hash2), 'password validates with second hash'); >+ >+ >-- >2.12.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18275
:
61110
|
61113
|
61114
|
61118
| 61167 |
61168