Lines 1921-1927
subtest '->store' => sub {
Link Here
|
1921 |
|
1921 |
|
1922 |
subtest '->set_password' => sub { |
1922 |
subtest '->set_password' => sub { |
1923 |
|
1923 |
|
1924 |
plan tests => 16; |
1924 |
plan tests => 17; |
1925 |
|
1925 |
|
1926 |
t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'emailpro|email' ); |
1926 |
t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'emailpro|email' ); |
1927 |
|
1927 |
|
Lines 1994-2003
subtest '->set_password' => sub {
Link Here
|
1994 |
|
1994 |
|
1995 |
# Enable logging password changes |
1995 |
# Enable logging password changes |
1996 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
1996 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
1997 |
$patron->set_password({ password => 'abcd b' }); |
1997 |
$patron->set_password( { password => 'abcd b' } ); |
1998 |
|
1998 |
$number_of_logs = $schema->resultset('ActionLog')->search( |
1999 |
$number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'CHANGE PASS', object => $patron->borrowernumber } )->count; |
1999 |
{ |
|
|
2000 |
module => 'MEMBERS', |
2001 |
action => 'CHANGE PASS', |
2002 |
object => $patron->borrowernumber |
2003 |
} |
2004 |
)->count; |
2000 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->set_password does log password changes' ); |
2005 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->set_password does log password changes' ); |
|
|
2006 |
# add other action name |
2007 |
$patron->set_password( { password => 'abcd b2', action => 'RESET PASS' } ); |
2008 |
$number_of_logs = $schema->resultset('ActionLog')->search( |
2009 |
{ |
2010 |
module => 'MEMBERS', |
2011 |
action => 'RESET PASS', |
2012 |
object => $patron->borrowernumber |
2013 |
} |
2014 |
)->count; |
2015 |
is( $number_of_logs, 1, 'set_password allows another action name' ); |
2001 |
|
2016 |
|
2002 |
# Enable notifying patrons of password changes |
2017 |
# Enable notifying patrons of password changes |
2003 |
t::lib::Mocks::mock_preference( 'NotifyPasswordChange', 1 ); |
2018 |
t::lib::Mocks::mock_preference( 'NotifyPasswordChange', 1 ); |
2004 |
- |
|
|