Bugzilla – Attachment 107492 Details for
Bug 26035
AutoMemberNum fails on very large cardnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26035: Add tests to highlight the problem
Bug-26035-Add-tests-to-highlight-the-problem.patch (text/plain), 2.08 KB, created by
Jonathan Druart
on 2020-07-29 12:33:18 UTC
(
hide
)
Description:
Bug 26035: Add tests to highlight the problem
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-07-29 12:33:18 UTC
Size:
2.08 KB
patch
obsolete
>From f0ab8108ab0a324d715951fc924b7370db236519 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 29 Jul 2020 14:32:43 +0200 >Subject: [PATCH] Bug 26035: Add tests to highlight the problem > >--- > t/db_dependent/Koha/Patrons.t | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 4f434adc3c..6520691dc7 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 41; >+use Test::More tests => 42; > use Test::Warn; > use Test::Exception; > use Test::MockModule; >@@ -2204,3 +2204,34 @@ subtest 'extended_attributes' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'fixup_cardnumber' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ Koha::Holds->search->delete; >+ Koha::Checkouts->search->delete; >+ Koha::Patrons->search->delete; >+ >+ my $new_patron = Koha::Patron->new->fixup_cardnumber; >+ is( $new_patron->cardnumber, 1, "NULL+1=1" ); >+ >+ $builder->build_object({ class => 'Koha::Patrons', value => {cardnumber => "a string"} }); >+ $builder->build_object({ class => 'Koha::Patrons', value => {cardnumber => 10} }); >+ $builder->build_object({ class => 'Koha::Patrons', value => {cardnumber => 100} }); >+ $builder->build_object({ class => 'Koha::Patrons', value => {cardnumber => 20} }); >+ $builder->build_object({ class => 'Koha::Patrons', value => {cardnumber => "a big 9999 string"} }); >+ $builder->build_object({ class => 'Koha::Patrons', value => {cardnumber => "P13000"} }); >+ >+ $new_patron = Koha::Patron->new->fixup_cardnumber; >+ is( $new_patron->cardnumber, 101, "100+1=101" ); >+ >+ $builder->build_object({ class => 'Koha::Patrons', value => {cardnumber => 603628999632182575912} }); >+ >+ $new_patron = Koha::Patron->new->fixup_cardnumber; >+ is( $new_patron->cardnumber, 603628999632182575914, "603628999632182575912+1=603628999632182575913" ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.20.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 26035
: 107492 |
107522
|
107655