Bugzilla – Attachment 122429 Details for
Bug 26352
Add plugin hooks to transform patron barcodes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26352: Add unit test
Bug-26352-Add-unit-test.patch (text/plain), 1.94 KB, created by
Kyle M Hall (khall)
on 2021-06-25 12:03:48 UTC
(
hide
)
Description:
Bug 26352: Add unit test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-06-25 12:03:48 UTC
Size:
1.94 KB
patch
obsolete
>From f788153bc95bcb5791c7b369a17ad94bb5a8351f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 12 Nov 2020 13:34:33 -0500 >Subject: [PATCH] Bug 26352: Add unit test > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t | 7 ++++++- > t/lib/Koha/Plugin/Test.pm | 5 +++++ > 2 files changed, 11 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t b/t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t >index 5a6b156f2a..684c7d8dfa 100755 >--- a/t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t >+++ b/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( > { >diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm >index ce8f1b26d9..6ae7d4a7b2 100644 >--- a/t/lib/Koha/Plugin/Test.pm >+++ b/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"; >-- >2.30.1 (Apple Git-130)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26352
:
109533
|
109547
|
113579
|
113580
|
113880
|
113885
|
113886
|
113887
|
113888
|
115167
|
115168
|
115169
|
115170
|
115171
|
118691
|
118692
|
118693
|
118694
|
118695
|
122428
| 122429 |
122430
|
122431
|
122432