Bugzilla – Attachment 29149 Details for
Bug 12416
DelUniqueDebarment (Debarments.pm) is not tested in Borrower_Debarments.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12416: the subroutine 'ok' is replaced by the subroutine 'is'
PASSED-QA-Bug-12416-the-subroutine-ok-is-replaced-.patch (text/plain), 5.04 KB, created by
Katrin Fischer
on 2014-06-22 20:06:59 UTC
(
hide
)
Description:
[PASSED QA] Bug 12416: the subroutine 'ok' is replaced by the subroutine 'is'
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-06-22 20:06:59 UTC
Size:
5.04 KB
patch
obsolete
>From be0425dc166b7daae96f22823ac4807d0d693fd9 Mon Sep 17 00:00:00 2001 >From: Yohann Dufour <dufour.yohann@gmail.com> >Date: Mon, 16 Jun 2014 09:31:13 +0200 >Subject: [PATCH] [PASSED QA] Bug 12416: the subroutine 'ok' is replaced by the > subroutine 'is' > >The use of the subroutine 'is' is prefered over the subroutine 'is' > >To test: execute the commande prove t/db_dependent/Borrower_Debarments.t >To command has to print: >t/db_dependent/Borrower_Debarments.t .. ok >All tests successful. >Files=1, Tests=22, 1 wallclock secs ( 0.03 usr 0.01 sys + 1.42 cusr 0.08 csys = 1.54 CPU) >Result: PASS > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Comments on last patch > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > t/db_dependent/Borrower_Debarments.t | 34 +++++++++++++++++----------------- > 1 file changed, 17 insertions(+), 17 deletions(-) > >diff --git a/t/db_dependent/Borrower_Debarments.t b/t/db_dependent/Borrower_Debarments.t >index 2f63fcf..7b44f01 100755 >--- a/t/db_dependent/Borrower_Debarments.t >+++ b/t/db_dependent/Borrower_Debarments.t >@@ -26,14 +26,14 @@ my $success = AddDebarment({ > type => 'MANUAL', > comment => 'Test 1', > }); >-ok( $success, "AddDebarment returned true" ); >+is( $success, 1, "AddDebarment returned true" ); > > > my $debarments = GetDebarments({ borrowernumber => $borrowernumber }); >-ok( @$debarments == 1, "GetDebarments returns 1 debarment" ); >-ok( $debarments->[0]->{'type'} eq 'MANUAL', "Correctly stored 'type'" ); >-ok( $debarments->[0]->{'expiration'} eq '9999-06-10', "Correctly stored 'expiration'" ); >-ok( $debarments->[0]->{'comment'} eq 'Test 1', "Correctly stored 'comment'" ); >+is( @$debarments, 1, "GetDebarments returns 1 debarment" ); >+is( $debarments->[0]->{'type'}, 'MANUAL', "Correctly stored 'type'" ); >+is( $debarments->[0]->{'expiration'}, '9999-06-10', "Correctly stored 'expiration'" ); >+is( $debarments->[0]->{'comment'}, 'Test 1', "Correctly stored 'comment'" ); > > > $success = AddDebarment({ >@@ -42,10 +42,10 @@ $success = AddDebarment({ > }); > > $debarments = GetDebarments({ borrowernumber => $borrowernumber }); >-ok( @$debarments == 2, "GetDebarments returns 2 debarments" ); >-ok( $debarments->[1]->{'type'} eq 'MANUAL', "Correctly stored 'type'" ); >-ok( !$debarments->[1]->{'expiration'}, "Correctly stored debarrment with no expiration" ); >-ok( $debarments->[1]->{'comment'} eq 'Test 2', "Correctly stored 'comment'" ); >+is( @$debarments, 2, "GetDebarments returns 2 debarments" ); >+is( $debarments->[1]->{'type'}, 'MANUAL', "Correctly stored 'type'" ); >+is( $debarments->[1]->{'expiration'}, undef, "Correctly stored debarrment with no expiration" ); >+is( $debarments->[1]->{'comment'}, 'Test 2', "Correctly stored 'comment'" ); > > > ModDebarment({ >@@ -54,12 +54,12 @@ ModDebarment({ > expiration => '9998-06-10', > }); > $debarments = GetDebarments({ borrowernumber => $borrowernumber }); >-ok( $debarments->[1]->{'comment'} eq 'Test 3', "ModDebarment functions correctly" ); >+is( $debarments->[1]->{'comment'}, 'Test 3', "ModDebarment functions correctly" ); > > > my $borrower = GetMember( borrowernumber => $borrowernumber ); >-ok( $borrower->{'debarred'} eq '9999-06-10', "Field borrowers.debarred set correctly" ); >-ok( $borrower->{'debarredcomment'} eq "Test 1\nTest 3", "Field borrowers.debarredcomment set correctly" ); >+is( $borrower->{'debarred'}, '9999-06-10', "Field borrowers.debarred set correctly" ); >+is( $borrower->{'debarredcomment'}, "Test 1\nTest 3", "Field borrowers.debarredcomment set correctly" ); > > > AddUniqueDebarment({ >@@ -70,8 +70,8 @@ $debarments = GetDebarments({ > borrowernumber => $borrowernumber, > type => 'OVERDUES', > }); >-ok( @$debarments == 1, "GetDebarments returns 1 OVERDUES debarment" ); >-ok( $debarments->[0]->{'type'} eq 'OVERDUES', "AddOverduesDebarment created new debarment correctly" ); >+is( @$debarments, 1, "GetDebarments returns 1 OVERDUES debarment" ); >+is( $debarments->[0]->{'type'}, 'OVERDUES', "AddOverduesDebarment created new debarment correctly" ); > > AddUniqueDebarment({ > borrowernumber => $borrowernumber, >@@ -82,8 +82,8 @@ $debarments = GetDebarments({ > borrowernumber => $borrowernumber, > type => 'OVERDUES', > }); >-ok( @$debarments == 1, "GetDebarments returns 1 OVERDUES debarment after running AddOverduesDebarment twice" ); >-ok( $debarments->[0]->{'expiration'} eq '9999-11-09', "AddOverduesDebarment updated OVERDUES debarment correctly" ); >+is( @$debarments, 1, "GetDebarments returns 1 OVERDUES debarment after running AddOverduesDebarment twice" ); >+is( $debarments->[0]->{'expiration'}, '9999-11-09', "AddOverduesDebarment updated OVERDUES debarment correctly" ); > > > DelUniqueDebarment({ >@@ -102,7 +102,7 @@ foreach my $d ( @$debarments ) { > DelDebarment( $d->{'borrower_debarment_id'} ); > } > $debarments = GetDebarments({ borrowernumber => $borrowernumber }); >-ok( @$debarments == 0, "DelDebarment functions correctly" ); >+is( @$debarments, 0, "DelDebarment functions correctly" ); > > $dbh->do(q|UPDATE borrowers SET debarred = '1970-01-01'|); > is( IsDebarred( $borrowernumber ), undef, 'A patron with a debarred date in the past is not debarred' ); >-- >1.9.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 12416
:
28834
|
28859
|
28860
|
28861
|
29139
|
29140
|
29141
|
29148
| 29149 |
29150