Bugzilla – Attachment 136454 Details for
Bug 31005
Cannot edit patrons in other categories if an extended attribute is mandatory and limited to a category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31005: Unit test
Bug-31005-Unit-test.patch (text/plain), 2.56 KB, created by
Nick Clemens (kidclamp)
on 2022-06-23 17:32:04 UTC
(
hide
)
Description:
Bug 31005: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-06-23 17:32:04 UTC
Size:
2.56 KB
patch
obsolete
>From 4699d6698207a23e840997c76eefd41dd5630c65 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 23 Jun 2022 17:22:53 +0000 >Subject: [PATCH] Bug 31005: Unit test > >--- > t/db_dependent/Koha/Patron.t | 41 +++++++++++++++++++++++++++++++++--- > 1 file changed, 38 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 37214105e5..977ec261d6 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -372,7 +372,7 @@ subtest 'is_superlibrarian() tests' => sub { > > subtest 'extended_attributes' => sub { > >- plan tests => 15; >+ plan tests => 16; > > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >@@ -649,14 +649,14 @@ subtest 'extended_attributes' => sub { > my $attribute_type_1 = $builder->build_object( > { > class => 'Koha::Patron::Attribute::Types', >- value => { mandatory => 1, class => 'a' } >+ value => { mandatory => 1, class => 'a', category_code => undef } > } > ); > > my $attribute_type_2 = $builder->build_object( > { > class => 'Koha::Patron::Attribute::Types', >- value => { mandatory => 0, class => 'a' } >+ value => { mandatory => 0, class => 'a', category_code => undef } > } > ); > >@@ -689,6 +689,41 @@ subtest 'extended_attributes' => sub { > > }; > >+ subtest 'limited category mandatory attributes tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ Koha::Patron::Attribute::Types->search->delete; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ >+ my $attribute_type_1 = $builder->build_object( >+ { >+ class => 'Koha::Patron::Attribute::Types', >+ value => { mandatory => 1, class => 'a', category_code => $patron->categorycode } >+ } >+ ); >+ >+ $patron->extended_attributes( >+ [ >+ { code => $attribute_type_1->code, attribute => 'a' } >+ ] >+ ); >+ >+ is( $patron->extended_attributes->count, 1, 'Extended attributes succeeded' ); >+ >+ $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ # new patron, new category - they shouldn't be required to have any attributes >+ >+ >+ ok( $patron->extended_attributes([]), "We can set no attributes, mandatory attribute for other category not required"); >+ >+ >+ }; >+ >+ >+ > }; > > subtest 'can_log_into() tests' => sub { >-- >2.30.2
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 31005
:
136454
|
136455
|
136499
|
136500
|
136501
|
136502