Bugzilla – Attachment 118506 Details for
Bug 27587
Use Basic auth on API tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27857: Get the right column
Bug-27857-Get-the-right-column.patch (text/plain), 2.89 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-19 11:03:26 UTC
(
hide
)
Description:
Bug 27857: Get the right column
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-19 11:03:26 UTC
Size:
2.89 KB
patch
obsolete
>From f422dc94e2d61c36229ba1d0c552c24cb0ac54ea Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 19 Mar 2021 07:56:39 -0300 >Subject: [PATCH] Bug 27857: Get the right column > >This patch makes the search for mandatory attribute types actually use >'code' instead of 'class' for comparisson. > >Tests are added to cover this behavior. > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Patron.t >=> SUCCESS: Tests pass! >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >https://bugs.koha-community.org/show_bug.cgi?id=27587 >--- > Koha/Patron.pm | 2 +- > t/db_dependent/Koha/Patron.t | 16 +++++++++++++--- > 2 files changed, 14 insertions(+), 4 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 1160084ca63..be83c399cea 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1576,7 +1576,7 @@ sub extended_attributes { > undef > }, > { join => 'borrower_attribute_types_branches' } >- )->get_column('class'); >+ )->get_column('code'); > for my $type ( @required_attribute_types ) { > Koha::Exceptions::Object::FKConstraint->throw( > broken_fk => "$type", >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 98b079f4c33..bf211af98eb 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -616,21 +616,21 @@ subtest 'extended_attributes' => sub { > > subtest 'globally mandatory attributes tests' => sub { > >- plan tests => 3; >+ plan tests => 5; > > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > > my $attribute_type_1 = $builder->build_object( > { > class => 'Koha::Patron::Attribute::Types', >- value => { mandatory => 1 } >+ value => { mandatory => 1, class => 'a' } > } > ); > > my $attribute_type_2 = $builder->build_object( > { > class => 'Koha::Patron::Attribute::Types', >- value => { mandatory => 0 } >+ value => { mandatory => 0, class => 'a' } > } > ); > >@@ -647,7 +647,17 @@ subtest 'extended_attributes' => sub { > 'Koha::Exceptions::Object::FKConstraint', > 'Exception thrown on missing mandatory attribute type'; > >+ is( $@->value, $attribute_type_1->code, 'Exception parameters are correct' ); >+ > is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); >+ >+ $patron->extended_attributes( >+ [ >+ { code => $attribute_type_1->code, attribute => 'b' } >+ ] >+ ); >+ >+ is( $patron->extended_attributes->count, 1, 'Extended attributes succeeded' ); > }; > > $schema->storage->txn_rollback; >-- >2.31.0
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 27587
:
116211
|
116212
|
116213
|
116214
|
116215
|
116319
|
116320
|
116321
|
116322
|
116323
|
116505
|
116506
|
116507
|
116508
|
116509
|
118506