|
Lines 53-67
subtest 'after_authority_action hook' => sub {
Link Here
|
| 53 |
my $plugin = Koha::Plugin::Test->new->enable; |
53 |
my $plugin = Koha::Plugin::Test->new->enable; |
| 54 |
my $id; |
54 |
my $id; |
| 55 |
|
55 |
|
| 56 |
warning_like { ( $id ) = C4::AuthoritiesMarc::AddAuthority( MARC::Record->new, undef, 'PERSO_NAME' ); } |
56 |
warnings_exist { ( $id ) = C4::AuthoritiesMarc::AddAuthority( MARC::Record->new, undef, 'PERSO_NAME' ); } |
| 57 |
qr/after_authority_action called with action: create, id: \d+/, |
57 |
qr/after_authority_action called with action: create, id: \d+/, |
| 58 |
'AddAuthority calls the hook with action=create, id passed'; |
58 |
'AddAuthority calls the hook with action=create, id passed'; |
| 59 |
|
59 |
|
| 60 |
warning_like { C4::AuthoritiesMarc::ModAuthority( $id, MARC::Record->new, 'PERSO_NAME', { skip_merge => 1 } ); } |
60 |
warnings_exist { C4::AuthoritiesMarc::ModAuthority( $id, MARC::Record->new, 'PERSO_NAME', { skip_merge => 1 } ); } |
| 61 |
qr/after_authority_action called with action: modify, id: $id/, |
61 |
qr/after_authority_action called with action: modify, id: $id/, |
| 62 |
'ModAuthority calls the hook with action=modify, id passed'; |
62 |
'ModAuthority calls the hook with action=modify, id passed'; |
| 63 |
|
63 |
|
| 64 |
warning_like { C4::AuthoritiesMarc::DelAuthority({ authid => $id, skip_merge => 1 }); } |
64 |
warnings_exist { C4::AuthoritiesMarc::DelAuthority({ authid => $id, skip_merge => 1 }); } |
| 65 |
qr/after_authority_action called with action: delete, id: $id/, |
65 |
qr/after_authority_action called with action: delete, id: $id/, |
| 66 |
'DelAuthority calls the hook with action=delete, id passed'; |
66 |
'DelAuthority calls the hook with action=delete, id passed'; |
| 67 |
|
67 |
|
| 68 |
- |
|
|