@@ -, +, @@ --- t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t | 7 ++++++- t/lib/Koha/Plugin/Test.pm | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) --- a/t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t +++ a/t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t @@ -42,7 +42,7 @@ t::lib::Mocks::mock_config( 'enable_plugins', 1 ); subtest '() hook tests' => sub { - plan tests => 1; + plan tests => 2; $schema->storage->txn_begin; @@ -52,6 +52,11 @@ subtest '() hook tests' => sub { my $plugin = Koha::Plugin::Test->new->enable; my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); + my $cardnumber = $patron->cardnumber; + + warning_like { $patron->store(); } + qr/patron_barcode_transform called with parameter: $cardnumber/, + 'Koha::Patron::store calls the patron_barcode_transform hook'; t::lib::Mocks::mock_userenv( { --- a/t/lib/Koha/Plugin/Test.pm +++ a/t/lib/Koha/Plugin/Test.pm @@ -98,6 +98,11 @@ sub item_barcode_transform { Koha::Exceptions::Exception->throw("item_barcode_transform called with parameter: $barcode"); } +sub patron_barcode_transform { + my ( $self, $barcode ) = @_; + Koha::Exceptions::Exception->throw("patron_barcode_transform called with parameter: $barcode"); +} + sub configure { my ( $self, $args ) = @_; return "Koha::Plugin::Test::configure"; --