Bugzilla – Attachment 118859 Details for
Bug 28031
Koha::Patron::Attribute->_check_repeatable doesn't exclude the object's ID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28031: Regression tests
Bug-28031-Regression-tests.patch (text/plain), 2.06 KB, created by
Kyle M Hall (khall)
on 2021-03-26 14:32:21 UTC
(
hide
)
Description:
Bug 28031: Regression tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-03-26 14:32:21 UTC
Size:
2.06 KB
patch
obsolete
>From 4ebd5430d606f3a98aef7f9c0139b67311075c36 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 25 Mar 2021 09:48:35 -0300 >Subject: [PATCH] Bug 28031: Regression tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/Patron/Attribute.t | 34 +++++++++++++++++++++++++- > 1 file changed, 33 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patron/Attribute.t b/t/db_dependent/Koha/Patron/Attribute.t >index b46d811374..670bc87cbf 100755 >--- a/t/db_dependent/Koha/Patron/Attribute.t >+++ b/t/db_dependent/Koha/Patron/Attribute.t >@@ -33,7 +33,7 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'store() tests' => sub { > >- plan tests => 3; >+ plan tests => 4; > > subtest 'repeatable attributes tests' => sub { > >@@ -215,6 +215,38 @@ subtest 'store() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+ subtest 'Edit attribute tests for non-repeatable tests (Bug 28031)' => sub { >+ >+ plan tests => 1; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $non_repeatable_type = $builder->build_object( >+ { >+ class => 'Koha::Patron::Attribute::Types', >+ value => { >+ mandatory => 0, >+ repeatable => 0, >+ unique_id => 1, >+ category_code => undef >+ } >+ } >+ ); >+ >+ # Here we test the case of editing an already stored attribute >+ my $non_repeatable_attr = $patron->add_extended_attribute( >+ { >+ code => $non_repeatable_type->code, >+ attribute => 'WOW' >+ } >+ ); >+ >+ $non_repeatable_attr->set({ attribute => 'HEY' }) >+ ->store >+ ->discard_changes; >+ >+ is( $non_repeatable_attr->attribute, 'HEY', 'Value stored correctly' ); >+ }; > }; > > subtest 'type() tests' => sub { >-- >2.24.1 (Apple Git-126)
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 28031
:
118792
|
118793
|
118794
|
118828
|
118829
|
118830
|
118831
|
118833
| 118859 |
118860
|
118861
|
118862
|
118863
|
119377
|
119378
|
119379
|
119380
|
119382