Bugzilla – Attachment 118692 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.92 KB, created by
Martin Renvoize (ashimema)
on 2021-03-23 16:35:21 UTC
(
hide
)
Description:
Bug 26352: Add unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-23 16:35:21 UTC
Size:
1.92 KB
patch
obsolete
>From 48ad1a10565568ac2dad9cc3ecf15945cab17070 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 24217d098f..137d2355a8 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.20.1
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