Bugzilla – Attachment 72147 Details for
Bug 19936
Move Check_userid and Generate_Userid to Koha::Patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19936: Adapt tests
Bug-19936-Adapt-tests.patch (text/plain), 2.42 KB, created by
Jonathan Druart
on 2018-02-23 17:15:52 UTC
(
hide
)
Description:
Bug 19936: Adapt tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-02-23 17:15:52 UTC
Size:
2.42 KB
patch
obsolete
>From b55a4b0f5e0f6dfa4e99e560105aea3a87e19fc2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 8 Jan 2018 18:48:49 -0300 >Subject: [PATCH] Bug 19936: Adapt tests > >And prove that we are not cheating >--- > t/db_dependent/Koha/Patrons.t | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index b2b5b206ca..14c3c6fbf6 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1204,14 +1204,15 @@ subtest 'generate_userid' => sub { > ); > > my $expected_userid_patron_1 = 'tomasito.none'; >- my $userid = C4::Members::Generate_Userid( undef, $data{firstname}, $data{surname} ); >- is( $userid, $expected_userid_patron_1, 'Generate_Userid should generate the userid we expect' ); >+ my $new_patron = Koha::Patron->new({ firstname => $data{firstname}, surname => $data{surname} } ); >+ my $userid = $new_patron->generate_userid; >+ is( $userid, $expected_userid_patron_1, 'generate_userid should generate the userid we expect' ); > my $borrowernumber = AddMember(%data); > my $patron_1 = Koha::Patrons->find($borrowernumber); > is ( $patron_1->userid, $expected_userid_patron_1, 'The userid generated should be the one we expect' ); > >- $userid = C4::Members::Generate_Userid( $borrowernumber, $data{firstname}, $data{surname} ); >- is( $userid, $expected_userid_patron_1 . '1', 'Generate_Userid should generate the userid we expect' ); >+ $userid = $new_patron->generate_userid; >+ is( $userid, $expected_userid_patron_1 . '1', 'generate_userid should generate the userid we expect' ); > $data{cardnumber} = '987654321'; > my $new_borrowernumber = AddMember(%data); > my $patron_2 = Koha::Patrons->find($new_borrowernumber); >@@ -1220,8 +1221,8 @@ subtest 'generate_userid' => sub { > is( $patron_2->userid, $expected_userid_patron_1 . '1', # TODO we could make that configurable > "Patron with duplicate userid has new userid generated (1 is appened" ); > >- $userid = C4::Members::Generate_Userid( $borrowernumber, $data{firstname}, $data{surname} ); >- is( $userid, $expected_userid_patron_1 . '2', 'Generate_Userid should generate the userid we expect' ); >+ $userid = $new_patron->generate_userid; >+ is( $userid, $expected_userid_patron_1 . '2', 'generate_userid should generate the userid we expect' ); > > # Cleanup > $patron_1->delete; >-- >2.11.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 19936
:
70365
|
70366
|
70367
|
70368
|
70369
|
70370
|
70371
|
70372
|
70373
|
70374
|
71787
|
71788
|
71789
|
71790
|
71791
|
71792
|
71793
|
71794
|
71795
|
71796
|
72129
|
72130
|
72131
|
72132
|
72133
|
72134
|
72135
|
72136
|
72137
|
72138
|
72139
|
72140
|
72141
|
72142
|
72143
|
72144
|
72145
|
72146
|
72147
|
72148
|
72149
|
72150
|
72151
|
72152
|
73630
|
73631
|
73632
|
73633
|
73634
|
73635
|
73636
|
73637
|
73638
|
73639
|
73640
|
73641
|
73963
|
73964
|
73965
|
73966
|
73967
|
73968
|
73969
|
73970
|
73971
|
73972
|
73973
|
73974
|
74071
|
74072
|
74073
|
74074
|
74075
|
74076
|
74077
|
74078
|
74079
|
74080
|
74081
|
74082