Bugzilla – Attachment 183578 Details for
Bug 34776
Patron messaging preferences are lost when an error occurs during new account creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34776: Unit tests
Bug-34776-Unit-tests.patch (text/plain), 1.64 KB, created by
Marcel de Rooy
on 2025-06-27 07:03:47 UTC
(
hide
)
Description:
Bug 34776: Unit tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-06-27 07:03:47 UTC
Size:
1.64 KB
patch
obsolete
>From 9d310822aee902cdb493d70e5c70dbcb21561514 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 23 Apr 2025 17:08:11 +0200 >Subject: [PATCH] Bug 34776: Unit tests >Content-Type: text/plain; charset=utf-8 > >Just a small beginning.. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/Form_MessagingPreferences.t | 31 +++++++++++++++++++++---------- > 1 file changed, 21 insertions(+), 10 deletions(-) > >diff --git a/t/Form_MessagingPreferences.t b/t/Form_MessagingPreferences.t >index 40a68dd402..fd1d5fee7b 100755 >--- a/t/Form_MessagingPreferences.t >+++ b/t/Form_MessagingPreferences.t >@@ -1,15 +1,26 @@ > #!/usr/bin/perl >-# >-# This Koha test module is a stub! >-# Add more tests here!!! > >-use strict; >-use warnings; >+use Modern::Perl; >+use CGI; >+use Template; > >-use Test::NoWarnings; >-use Test::More tests => 2; >+use Test::More tests => 1; >+use Test::MockModule; >+#use Test::NoWarnings; > >-BEGIN { >- use_ok('C4::Form::MessagingPreferences'); >-} >+use C4::Form::MessagingPreferences; > >+subtest 'restore_values' => sub { >+ plan tests => 1; >+ my $cgi = CGI->new; >+ my $template_module = Test::MockModule->new( 'Template' ); >+ my $vars = {}; >+ $template_module->mock( 'param', sub { my ( $self, $key, $val ) = @_; $vars->{$key} = $val; } ); >+ my $template = Template->new( ENCODING => 'UTF-8' ); >+ >+ C4::Form::MessagingPreferences::restore_form_values( $cgi, $template ); >+ require Data::Dumper; warn Data::Dumper::Dumper( $vars ); #FIXME Remove debugging >+ # TODO Add some checking on $vars->{messaging_preferences} here >+ >+ ok(1); # FIXME Replace >+}; >-- >2.39.5
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 34776
:
178702
|
178896
|
180100
|
181389
|
181433
|
181434
|
183221
|
183222
|
183236
|
183237
|
183238
|
183239
|
183573
|
183574
|
183575
|
183576
|
183577
| 183578 |
183579
|
183580