Bugzilla – Attachment 156203 Details for
Bug 27634
Turn off patron self-registration if no default category is set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27634: Fix self_registration.t
Bug-27634-Fix-selfregistrationt.patch (text/plain), 2.28 KB, created by
Jonathan Druart
on 2023-09-26 09:36:16 UTC
(
hide
)
Description:
Bug 27634: Fix self_registration.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-09-26 09:36:16 UTC
Size:
2.28 KB
patch
obsolete
>From 90a43e437b6ff49a33ba9bb4c0638693a9dc54a4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 26 Sep 2023 11:35:45 +0200 >Subject: [PATCH] Bug 27634: Fix self_registration.t > >--- > t/db_dependent/selenium/self_registration.t | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/selenium/self_registration.t b/t/db_dependent/selenium/self_registration.t >index 228db4b70da..3a1b0e79298 100755 >--- a/t/db_dependent/selenium/self_registration.t >+++ b/t/db_dependent/selenium/self_registration.t >@@ -33,7 +33,7 @@ eval { require Selenium::Remote::Driver; }; > if ( $@ ) { > plan skip_all => "Selenium::Remote::Driver is needed for selenium tests."; > } else { >- plan tests => 1; >+ plan tests => 2; > } > > my $s = t::lib::Selenium->new; >@@ -45,11 +45,23 @@ my $builder = t::lib::TestBuilder->new; > my $PatronSelfRegistration_value = C4::Context->preference('PatronSelfRegistration'); > C4::Context->set_preference('PatronSelfRegistration', '1'); > >+my $PatronSelfRegistrationDefaultCategory_value = C4::Context->preference('PatronSelfRegistrationDefaultCategory'); >+ > our @cleanup; > >+subtest 'Disable if no default category' => sub { >+ plan tests => 1; >+ >+ $driver->get( $opac_base_url . 'opac-memberentry.pl' ); >+ like( $driver->get_title(), qr(Koha online catalog), ); >+}; >+ > subtest 'Set flags' => sub { > plan tests => 2; > >+ my $default_category = $builder->build_object( { class => 'Koha::Patron::Categories' } ); >+ C4::Context->set_preference( 'PatronSelfRegistrationDefaultCategory', $default_category->categorycode ); >+ > $driver->get($opac_base_url . 'opac-memberentry.pl'); > like( $driver->get_title(), qr(Register a new account), ); > >@@ -64,6 +76,7 @@ subtest 'Set flags' => sub { > my $patron = Koha::Patrons->search({ surname => "a surname" })->next; > is( $patron->flags, undef, 'flags must be undef even if user tried to pass it' ); > push @cleanup, $patron; >+ push @cleanup, $default_category; > }; > > >@@ -71,5 +84,6 @@ $driver->quit(); > > END { > C4::Context->set_preference('PatronSelfRegistration', $PatronSelfRegistration_value); >+ C4::Context->set_preference('PatronSelfRegistration', $PatronSelfRegistrationDefaultCategory_value); > $_->delete for @cleanup; > }; >-- >2.25.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 27634
:
116378
|
116379
|
116380
|
116381
|
116382
|
116383
|
116491
|
145599
|
145600
|
145601
|
145602
|
145603
|
145604
|
145605
|
145922
|
147531
|
147532
|
147533
|
147534
|
147535
|
147536
|
147537
|
149746
|
149747
|
149748
|
149896
|
149897
|
149898
|
149899
|
149900
|
149901
|
149902
|
150083
|
150084
|
150085
|
150086
|
150087
|
150088
|
150089
|
150090
|
151046
|
151047
|
151048
|
151049
|
155863
|
155864
|
155865
|
155866
|
155867
|
155868
|
155869
|
155870
| 156203