Bugzilla – Attachment 14090 Details for
Bug 7067
allow patron self registration via the opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7067 QA Followup - Add descriptions to tests
Bug-7067-QA-Followup---Add-descriptions-to-tests.patch (text/plain), 6.62 KB, created by
Kyle M Hall
on 2012-12-13 17:28:51 UTC
(
hide
)
Description:
Bug 7067 QA Followup - Add descriptions to tests
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-12-13 17:28:51 UTC
Size:
6.62 KB
patch
obsolete
>From 4866aeadf49351ee66df75d7081548a5a0d84c88 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 13 Dec 2012 12:28:02 -0500 >Subject: [PATCH] Bug 7067 QA Followup - Add descriptions to tests > >--- > t/db_dependent/Koha_borrower_modifications.t | 97 +++++++++++++++++--------- > 1 files changed, 64 insertions(+), 33 deletions(-) > >diff --git a/t/db_dependent/Koha_borrower_modifications.t b/t/db_dependent/Koha_borrower_modifications.t >index cc30313..6a7c4c4 100755 >--- a/t/db_dependent/Koha_borrower_modifications.t >+++ b/t/db_dependent/Koha_borrower_modifications.t >@@ -11,84 +11,115 @@ use Koha::Borrower::Modifications; > C4::Context->dbh->do("TRUNCATE TABLE borrower_modifications"); > > ## Create new pending modification >-Koha::Borrower::Modifications->new( verification_token => '1234567890' )->AddModifications({ surname => 'Hall', firstname => 'Kyle' }); >+Koha::Borrower::Modifications->new( verification_token => '1234567890' ) >+ ->AddModifications( { surname => 'Hall', firstname => 'Kyle' } ); > > ## Get the new pending modification >-my $borrower = Koha::Borrower::Modifications->GetModifications({ >- verification_token => '1234567890' >-}); >+my $borrower = Koha::Borrower::Modifications->GetModifications( >+ { verification_token => '1234567890' } ); > > ## Verify we get the same data >-ok( $borrower->{'surname'} = 'Hall' ); >+ok( $borrower->{'surname'} = 'Hall', >+ 'Test AddModifications() and GetModifications()' ); > > ## Check the Verify method >-ok( Koha::Borrower::Modifications->Verify( '1234567890' ) ); >+ok( >+ Koha::Borrower::Modifications->Verify('1234567890'), >+ 'Test that Verify() succeeds with a valid token' >+); > > ## Delete the pending modification >-$borrower = Koha::Borrower::Modifications->DelModifications({ >- verification_token => '1234567890' >-}); >+$borrower = Koha::Borrower::Modifications->DelModifications( >+ { verification_token => '1234567890' } ); > > ## Verify it's no longer in the database >-$borrower = Koha::Borrower::Modifications->GetModifications({ >- verification_token => '1234567890' >-}); >-ok( !defined( $borrower->{'surname'} ) ); >+$borrower = Koha::Borrower::Modifications->GetModifications( >+ { verification_token => '1234567890' } ); >+ok( !defined( $borrower->{'surname'} ), 'Test DelModifications()' ); > > ## Check the Verify method >-ok( !Koha::Borrower::Modifications->Verify( '1234567890' ) ); >+ok( >+ !Koha::Borrower::Modifications->Verify('1234567890'), >+ 'Test that Verify() method fails for a bad token' >+); > > ## Create new pending modification, but for an existing borrower >-Koha::Borrower::Modifications->new( borrowernumber => '2' )->AddModifications({ surname => 'Hall', firstname => 'Kyle' }); >+Koha::Borrower::Modifications->new( borrowernumber => '2' ) >+ ->AddModifications( { surname => 'Hall', firstname => 'Kyle' } ); > > ## Test the counter >-ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1 ); >+ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1, >+ 'Test GetPendingModificationsCount()' ); > > ## Create new pending modification for another existing borrower >-Koha::Borrower::Modifications->new( borrowernumber => '3' )->AddModifications({ surname => 'Smith', firstname => 'Sandy' }); >+Koha::Borrower::Modifications->new( borrowernumber => '3' ) >+ ->AddModifications( { surname => 'Smith', firstname => 'Sandy' } ); > > ## Test the counter >-ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 2 ); >+ok( >+ Koha::Borrower::Modifications->GetPendingModificationsCount() == 2, >+'Add a new pending modification and test GetPendingModificationsCount() again' >+); > > ## Check GetPendingModifications > my $pending = Koha::Borrower::Modifications->GetPendingModifications(); >-ok( $pending->[0]->{'firstname'} eq 'Kyle' ); >-ok( $pending->[1]->{'firstname'} eq 'Sandy' ); >+ok( $pending->[0]->{'firstname'} eq 'Kyle', 'Test GetPendingModifications()' ); >+ok( >+ $pending->[1]->{'firstname'} eq 'Sandy', >+ 'Test GetPendingModifications() again' >+); > > ## This should delete the row from the table >-Koha::Borrower::Modifications->DenyModifications( '3' ); >+Koha::Borrower::Modifications->DenyModifications('3'); > > ## Test the counter >-ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1 ); >+ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1, >+ 'Test DenyModifications()' ); > > ## Save a copy of the borrowers original data >-my $old_borrower = GetMember(borrowernumber => '2' ); >+my $old_borrower = GetMember( borrowernumber => '2' ); > > ## Apply the modifications >-Koha::Borrower::Modifications->ApproveModifications( '2' ); >+Koha::Borrower::Modifications->ApproveModifications('2'); > > ## Test the counter >-ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 0 ); >+ok( >+ Koha::Borrower::Modifications->GetPendingModificationsCount() == 0, >+ 'Test ApproveModifications() removes pending modification from db' >+); > > ## Get a copy of the borrowers current data >-my $new_borrower = GetMember(borrowernumber => '2' ); >+my $new_borrower = GetMember( borrowernumber => '2' ); > > ## Check to see that the approved modifications were saved >-ok( $new_borrower->{'surname'} eq 'Hall' ); >+ok( $new_borrower->{'surname'} eq 'Hall', >+ 'Test ApproveModifications() applys modification to borrower' ); > > ## Now let's put it back the way it was >-Koha::Borrower::Modifications->new( borrowernumber => '2' )->AddModifications({ surname => $old_borrower->{'surname'}, firstname => $old_borrower->{'firstname'} }); >+Koha::Borrower::Modifications->new( borrowernumber => '2' )->AddModifications( >+ { >+ surname => $old_borrower->{'surname'}, >+ firstname => $old_borrower->{'firstname'} >+ } >+); > > ## Test the counter >-ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1 ); >+ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1, >+ 'Test GetPendingModificationsCount()' ); > > ## Apply the modifications >-Koha::Borrower::Modifications->ApproveModifications( '2' ); >+Koha::Borrower::Modifications->ApproveModifications('2'); > > ## Test the counter >-ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 0 ); >+ok( >+ Koha::Borrower::Modifications->GetPendingModificationsCount() == 0, >+ 'Test ApproveModifications() removes pending modification from db, again' >+); > >-$new_borrower = GetMember(borrowernumber => '2' ); >+$new_borrower = GetMember( borrowernumber => '2' ); > > ## Test to verify the borrower has been updated with the original values >-ok( $new_borrower->{'surname'} eq $old_borrower->{'surname'} ); >+ok( >+ $new_borrower->{'surname'} eq $old_borrower->{'surname'}, >+ 'Test ApproveModifications() applys modification to borrower, again' >+); >-- >1.7.2.5
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 7067
:
11960
|
11961
|
11962
|
11965
|
11966
|
11967
|
11968
|
11970
|
11973
|
11978
|
12006
|
12007
|
12013
|
12104
|
12109
|
12114
|
12116
|
12129
|
12135
|
12136
|
12138
|
12153
|
12154
|
12171
|
12190
|
12191
|
12196
|
12197
|
12242
|
12243
|
12244
|
12245
|
12277
|
12278
|
13038
|
13039
|
13040
|
13048
|
13053
|
13259
|
13260
|
13744
|
13745
|
13746
|
13747
|
13748
|
13765
|
13766
|
13767
|
13768
|
13769
|
13984
|
14001
|
14085
|
14086
|
14087
|
14088
|
14089
|
14090
|
14092
|
14093
|
14119
|
14190
|
14191
|
14193
|
14194
|
14282
|
14283