|
Lines 154-160
subtest 'validate_secret() tests' => sub {
Link Here
|
| 154 |
)->first; |
154 |
)->first; |
| 155 |
ok( $log_entry, 'CREATE log entry found' ); |
155 |
ok( $log_entry, 'CREATE log entry found' ); |
| 156 |
is( $log_entry->object, $test_patron->id, 'Log object is patron_id' ); |
156 |
is( $log_entry->object, $test_patron->id, 'Log object is patron_id' ); |
| 157 |
like( $log_entry->info, qr/Client ID: .+, Description: logged/, 'Log info contains client_id and description' ); |
157 |
like( $log_entry->info, qr/logged/, 'Log info contains description' ); |
| 158 |
|
158 |
|
| 159 |
# Test no CREATE logging when ApiKeyLog is disabled |
159 |
# Test no CREATE logging when ApiKeyLog is disabled |
| 160 |
t::lib::Mocks::mock_preference( 'ApiKeyLog', 0 ); |
160 |
t::lib::Mocks::mock_preference( 'ApiKeyLog', 0 ); |
|
Lines 178-187
subtest 'validate_secret() tests' => sub {
Link Here
|
| 178 |
)->first; |
178 |
)->first; |
| 179 |
ok( $delete_log, 'DELETE log entry found' ); |
179 |
ok( $delete_log, 'DELETE log entry found' ); |
| 180 |
is( $delete_log->object, $test_patron->id, 'DELETE log object is patron_id' ); |
180 |
is( $delete_log->object, $test_patron->id, 'DELETE log object is patron_id' ); |
| 181 |
like( |
181 |
|
| 182 |
$delete_log->info, qr/Client ID: $client_id_to_delete, Description: logged/, |
182 |
# DELETE logs pass undef for info field, object is in diff field |
| 183 |
'DELETE log info contains client_id and description' |
183 |
is( $delete_log->info, undef, 'DELETE log info is undef as expected' ); |
| 184 |
); |
|
|
| 185 |
|
184 |
|
| 186 |
# Test no DELETE logging when ApiKeyLog is disabled |
185 |
# Test no DELETE logging when ApiKeyLog is disabled |
| 187 |
t::lib::Mocks::mock_preference( 'ApiKeyLog', 0 ); |
186 |
t::lib::Mocks::mock_preference( 'ApiKeyLog', 0 ); |
|
Lines 247-253
subtest 'revoke() tests' => sub {
Link Here
|
| 247 |
ok( $revoke_log, 'REVOKE log entry found' ); |
246 |
ok( $revoke_log, 'REVOKE log entry found' ); |
| 248 |
is( $revoke_log->object, $patron->id, 'REVOKE log object is patron_id' ); |
247 |
is( $revoke_log->object, $patron->id, 'REVOKE log object is patron_id' ); |
| 249 |
like( |
248 |
like( |
| 250 |
$revoke_log->info, qr/Client ID: $client_id_to_revoke, Description: test2/, |
249 |
$revoke_log->info, qr/$client_id_to_revoke.*test2/s, |
| 251 |
'REVOKE log info contains client_id and description' |
250 |
'REVOKE log info contains client_id and description' |
| 252 |
); |
251 |
); |
| 253 |
|
252 |
|
|
Lines 301-307
subtest 'activate() tests' => sub {
Link Here
|
| 301 |
ok( $activate_log, 'ACTIVATE log entry found' ); |
300 |
ok( $activate_log, 'ACTIVATE log entry found' ); |
| 302 |
is( $activate_log->object, $patron->id, 'ACTIVATE log object is patron_id' ); |
301 |
is( $activate_log->object, $patron->id, 'ACTIVATE log object is patron_id' ); |
| 303 |
like( |
302 |
like( |
| 304 |
$activate_log->info, qr/Client ID: $client_id_to_activate, Description: test2/, |
303 |
$activate_log->info, qr/$client_id_to_activate.*test2/s, |
| 305 |
'ACTIVATE log info contains client_id and description' |
304 |
'ACTIVATE log info contains client_id and description' |
| 306 |
); |
305 |
); |
| 307 |
|
306 |
|
| 308 |
- |
|
|