Bugzilla – Attachment 178686 Details for
Bug 30657
Make patron attributes available via Template Toolkit in notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30657: Unit tests
Bug-30657-Unit-tests.patch (text/plain), 1.90 KB, created by
Martin Renvoize (ashimema)
on 2025-02-25 16:40:59 UTC
(
hide
)
Description:
Bug 30657: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-02-25 16:40:59 UTC
Size:
1.90 KB
patch
obsolete
>From fe64cda187b41c050d9476ab862a836922f763fa Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 16 Jul 2024 16:43:53 +0100 >Subject: [PATCH] Bug 30657: Unit tests > >This patch adds some basic unit tests for dynamically added accessors >based on extended patron attributes. >--- > t/db_dependent/Koha/Patron.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index f1ea69f0468..07cbbc3edea 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -800,7 +800,7 @@ subtest 'is_superlibrarian() tests' => sub { > > subtest 'extended_attributes' => sub { > >- plan tests => 16; >+ plan tests => 17; > > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >@@ -1193,8 +1193,33 @@ subtest 'extended_attributes' => sub { > "We can set no attributes, mandatory attribute for other category not required" > ); > >+ $schema->storage->txn_rollback; > }; > >+ subtest 'attribute accessor tests' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ Koha::Patron::Attribute::Types->search->delete; >+ >+ my $attribute_type_1 = $builder->build_object( >+ { >+ class => 'Koha::Patron::Attribute::Types', >+ value => { code => 'smartnumber', repeatable => 0 } >+ } >+ ); >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ >+ is( $patron->smartnumber, undef, 'smartnumber accessor returns undef when not set' ); >+ >+ $patron->extended_attributes( [ { code => 'smartnumber', attribute => 'SM1234' } ] ); >+ >+ is( $patron->smartnumber, 'SM1234', 'smartnumber accessor returns value when set' ); >+ >+ $schema->storage->txn_rollback; >+ }; > }; > > subtest 'can_log_into() tests' => sub { >-- >2.48.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 30657
:
169049
|
169050
|
169056
|
169057
|
173817
|
173818
|
173819
|
173901
|
173902
|
173910
|
173911
|
173912
|
173913
|
173914
| 178686 |
178687
|
178688
|
178689
|
178690