Lines 69-81
subtest 'check_password hook tests' => sub {
Link Here
|
69 |
|
69 |
|
70 |
throws_ok { $patron->store } 'Koha::Exceptions::Password::Plugin', |
70 |
throws_ok { $patron->store } 'Koha::Exceptions::Password::Plugin', |
71 |
'Exception raised for adding patron with bad password'; |
71 |
'Exception raised for adding patron with bad password'; |
72 |
$patron->password('1234'); |
72 |
$patron->password('12345678'); |
73 |
ok( $patron->store, 'Patron created with good password' ); |
73 |
ok( $patron->store, 'Patron created with good password' ); |
74 |
|
74 |
|
75 |
t::lib::Mocks::mock_preference( 'RequireStrongPassword', '0' ); |
75 |
t::lib::Mocks::mock_preference( 'RequireStrongPassword', '0' ); |
76 |
throws_ok { $patron->set_password({ password => 'explosion' }) } 'Koha::Exceptions::Password::Plugin', |
76 |
throws_ok { $patron->set_password({ password => 'explosion' }) } 'Koha::Exceptions::Password::Plugin', |
77 |
'Exception raised for update patron password with bad string'; |
77 |
'Exception raised for update patron password with bad string'; |
78 |
ok( $patron->set_password({ password => '4321' }), 'Patron password updated with good string' ); |
78 |
ok( $patron->set_password({ password => '87654321' }), 'Patron password updated with good string' ); |
79 |
ok( $patron->set_password({ password => 'explosion', skip_validation => 1}), 'Patron password updated via skip validation'); |
79 |
ok( $patron->set_password({ password => 'explosion', skip_validation => 1}), 'Patron password updated via skip validation'); |
80 |
|
80 |
|
81 |
$schema->storage->txn_rollback; |
81 |
$schema->storage->txn_rollback; |