Bugzilla – Attachment 77006 Details for
Bug 18635
Koha::Patron->guarantees() should return results alphabetically
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18635 - Unit tests
Bug-18635---Unit-tests.patch (text/plain), 3.22 KB, created by
Nick Clemens (kidclamp)
on 2018-07-16 14:58:57 UTC
(
hide
)
Description:
Bug 18635 - Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2018-07-16 14:58:57 UTC
Size:
3.22 KB
patch
obsolete
>From 7bd6c438a820a93ff6432e4c7d944c767b78559a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 18 May 2017 21:07:11 -0400 >Subject: [PATCH] Bug 18635 - Unit tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To test: >1 - Apply this patch only >2 - Prove t/db_dependent/Patron.t >3 - Tests fail >4 - Apply other patch >5 - Tests pass > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > t/db_dependent/Koha/Patrons.t | 55 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 54 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index bb6e2bc..0266e26 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 => 31; >+use Test::More tests => 32; > use Test::Warn; > use Time::Fake; > use DateTime; >@@ -1377,6 +1377,59 @@ subtest 'Log cardnumber change' => sub { > is( scalar @logs, 2, 'With BorrowerLogs, Change in cardnumber should be logged, as well as general alert of patron mod.' ); > }; > >+subtest 'Patron->guarantees' => sub { >+ plan tests => 5; >+ >+ my $builder = t::lib::TestBuilder->new; >+ >+ my $categorycode = $builder->build({ source => 'Category' })->{categorycode}; >+ my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >+ >+ my $guarantor = $builder->build_object( { class => 'Koha::Patrons' } ); >+ >+ my $guarantee1 = $builder->build_object( { class => 'Koha::Patrons' , value => { >+ surname => 'Zebra', >+ guarantorid => $guarantor->borrowernumber >+ } >+ })->borrowernumber; >+ >+ my $guarantee2 = $builder->build_object( { class => 'Koha::Patrons' , value => { >+ surname => 'Yak', >+ guarantorid => $guarantor->borrowernumber >+ } >+ })->borrowernumber; >+ >+ my $guarantee3 = $builder->build_object( { class => 'Koha::Patrons' , value => { >+ surname => 'Xerus', >+ firstname => 'Walrus', >+ guarantorid => $guarantor->borrowernumber >+ } >+ })->borrowernumber; >+ >+ my $guarantee4 = $builder->build_object( { class => 'Koha::Patrons' , value => { >+ surname => 'Xerus', >+ firstname => 'Vulture', >+ guarantorid => $guarantor->borrowernumber >+ } >+ })->borrowernumber; >+ >+ my $guarantee5 = $builder->build_object( { class => 'Koha::Patrons' , value => { >+ surname => 'Xerus', >+ firstname => 'Unicorn', >+ guarantorid => $guarantor->borrowernumber >+ } >+ })->borrowernumber; >+ >+ my $guarantees = $guarantor->guarantees(); >+ >+ is( $guarantees->next()->borrowernumber, $guarantee5, "Return first guarantor alphabetically" ); >+ is( $guarantees->next()->borrowernumber, $guarantee4, "Return second guarantor alphabetically" ); >+ is( $guarantees->next()->borrowernumber, $guarantee3, "Return third guarantor alphabetically" ); >+ is( $guarantees->next()->borrowernumber, $guarantee2, "Return fourth guarantor alphabetically" ); >+ is( $guarantees->next()->borrowernumber, $guarantee1, "Return fifth guarantor alphabetically" ); >+ >+}; >+ > $schema->storage->txn_rollback; > > subtest 'Test Koha::Patrons::merge' => sub { >-- >2.1.4
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 18635
:
63552
|
63553
|
63558
|
63559
|
63617
|
66557
|
66558
|
77005
|
77006
|
77011
|
77012
|
77013
|
77435
|
77436