Bugzilla – Attachment 8459 Details for
Bug 5668
Star ratings in the opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Enh 5668 Followup: only run borrower-specific unit tests if borrowers exist
Enh-5668-Followup-only-run-borrower-specific-unit-.patch (text/plain), 3.17 KB, created by
Ian Walls
on 2012-03-22 02:03:11 UTC
(
hide
)
Description:
Enh 5668 Followup: only run borrower-specific unit tests if borrowers exist
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2012-03-22 02:03:11 UTC
Size:
3.17 KB
patch
obsolete
>From 8cbead9734f572d4b805d515f86df4b46f570275 Mon Sep 17 00:00:00 2001 >From: Ian Walls <koha.sekjal@gmail.com> >Date: Wed, 21 Mar 2012 21:33:53 -0400 >Subject: [PATCH] Enh 5668 Followup: only run borrower-specific unit tests if borrowers exist > >If the borrowers 102 and 103 don't exist, skip the tests that call for them. > >This leaves just 2 running tests on most DBs, but this will help quiet the >automated test suites, and will still run if the right data is installed. >--- > t/db_dependent/Ratings.t | 44 +++++++++++++++++++++++++------------------- > 1 files changed, 25 insertions(+), 19 deletions(-) > >diff --git a/t/db_dependent/Ratings.t b/t/db_dependent/Ratings.t >index 0c2aee5..23bde86 100755 >--- a/t/db_dependent/Ratings.t >+++ b/t/db_dependent/Ratings.t >@@ -3,6 +3,7 @@ > use strict; > use warnings; > use Test::More tests => 12; >+use C4::Members; > > BEGIN { > >@@ -13,27 +14,32 @@ BEGIN { > DelRating( 1, 901 ); > DelRating( 1, 902 ); > >- my $rating1 = AddRating( 1, 102, 3 ); >- my $rating2 = AddRating( 1, 103, 4 ); >- my $rating3 = ModRating( 1, 102, 5 ); >- my $rating4 = GetRating( 1, 103 ); > my $rating5 = GetRating( 1, undef ); >- my $rating6 = DelRating( 1, 102 ); >- my $rating7 = DelRating( 1, 103 ); >- >- ok( defined $rating1, 'add a rating' ); >- ok( defined $rating2, 'add another rating' ); >- ok( defined $rating3, 'update a rating' ); >- ok( defined $rating4, 'get a rating, with borrowernumber' ); > ok( defined $rating5, 'get a rating, without borrowernumber' ); >- ok( $rating3->{'rating_avg'} == '4', "get a bib's average(float) rating" ); >- ok( $rating3->{'rating_avg_int'} == 4.5, >- "get a bib's average(int) rating" ); >- ok( $rating3->{'rating_total'} == 2, >- "get a bib's total number of ratings" ); >- ok( $rating3->{'rating_value'} == 5, "verify user's bib rating" ); >- ok( defined $rating6, 'delete a rating' ); >- ok( defined $rating7, 'delete another rating' ); >+ >+ my $borrower102 = GetMember( borrowernumber => 102); >+ my $borrower103 = GetMember( borrowernumber => 103); >+ SKIP: { >+ skip 'Missing test borrowers, skipping specific tests', 10 unless ( defined $borrower102 && defined $borrower103 ); >+ my $rating1 = AddRating( 1, 102, 3 ); >+ my $rating2 = AddRating( 1, 103, 4 ); >+ my $rating3 = ModRating( 1, 102, 5 ); >+ my $rating4 = GetRating( 1, 103 ); >+ my $rating6 = DelRating( 1, 102 ); >+ my $rating7 = DelRating( 1, 103 ); >+ >+ ok( defined $rating1, 'add a rating' ); >+ ok( defined $rating2, 'add another rating' ); >+ ok( defined $rating3, 'update a rating' ); >+ ok( defined $rating4, 'get a rating, with borrowernumber' ); >+ ok( defined $rating6, 'delete a rating' ); >+ ok( defined $rating7, 'delete another rating' ); >+ >+ ok( $rating3->{'rating_avg'} == '4', "get a bib's average(float) rating" ); >+ ok( $rating3->{'rating_avg_int'} == 4.5, "get a bib's average(int) rating" ); >+ ok( $rating3->{'rating_total'} == 2, "get a bib's total number of ratings" ); >+ ok( $rating3->{'rating_value'} == 5, "verify user's bib rating" ); >+ } > > } > >-- >1.7.0.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 5668
:
3034
|
3035
|
5097
|
5098
|
5136
|
5137
|
5792
|
5794
|
5833
|
7116
|
7165
|
7166
|
7215
|
7604
|
7798
|
8027
|
8199
|
8202
|
8312
|
8326
|
8359
|
8459
|
8514
|
8537
|
8548
|
8613
|
8704
|
8705
|
8706
|
9159
|
9163
|
9164