Bugzilla – Attachment 20825 Details for
Bug 10656
shelving locations not alpha on search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10656: add regression test
Bug-10656-add-regression-test.patch (text/plain), 4.91 KB, created by
Kyle M Hall (khall)
on 2013-09-06 15:24:04 UTC
(
hide
)
Description:
Bug 10656: add regression test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-09-06 15:24:04 UTC
Size:
4.91 KB
patch
obsolete
>From 3ecabf462cedb00af2327276f4c3147ec825b972 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Tue, 20 Aug 2013 16:59:06 +0000 >Subject: [PATCH] Bug 10656: add regression test > >This patch adds regression tests to verify the sort >order when fetching authorised values in either staff >or OPAC mode. > >This patch also wraps the Koha.t tests in a transaction, and >better handles skipping tests if Test::Deep is not installed. > >To test: > >[1] Verify that prove -v t/db_dependent/Koha.t passes > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Tests pass with all patches applied. > >http://bugs.koha-community.org/show_bug.cgi?id=10565 >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha.t | 86 +++++++++++++++++++++++++++++++++++++++++++++++-- > 1 files changed, 83 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t >index 9a5bf80..16ef67d 100644 >--- a/t/db_dependent/Koha.t >+++ b/t/db_dependent/Koha.t >@@ -11,17 +11,17 @@ use Koha::DateUtils qw(dt_from_string); > use Test::More tests => 6; > use DateTime::Format::MySQL; > >-eval {use Test::Deep;}; >- > BEGIN { > use_ok('C4::Koha', qw( :DEFAULT GetDailyQuote )); > use_ok('C4::Members'); > } > > my $dbh = C4::Context->dbh; >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; > > subtest 'Authorized Values Tests' => sub { >- plan tests => 6; >+ plan tests => 8; > > my $data = { > category => 'CATEGORY', >@@ -60,6 +60,85 @@ subtest 'Authorized Values Tests' => sub { > my $sth = $dbh->prepare($query); > $sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl}); > } >+ >+ SKIP: { >+ eval { require Test::Deep; import Test::Deep; }; >+ skip "Test::Deep required to run the GetAuthorisedValues() tests.", 2 if $@; >+ AddAuthorisedValue('BUG10656', 'ZZZ', 'Z_STAFF', 'A_PUBLIC', ''); >+ AddAuthorisedValue('BUG10656', 'AAA', 'A_STAFF', 'Z_PUBLIC', ''); >+ # the next one sets lib_opac to NULL; in that case, the staff >+ # display value is meant to be used. >+ AddAuthorisedValue('BUG10656', 'DDD', 'D_STAFF', undef, ''); >+ my $authvals = GetAuthorisedValues('BUG10656'); >+ cmp_deeply( >+ $authvals, >+ [ >+ { >+ id => ignore(), >+ category => 'BUG10656', >+ authorised_value => 'AAA', >+ selected => 0, >+ lib => 'A_STAFF', >+ lib_opac => 'Z_PUBLIC', >+ imageurl => '', >+ }, >+ { >+ id => ignore(), >+ category => 'BUG10656', >+ authorised_value => 'DDD', >+ selected => 0, >+ lib => 'D_STAFF', >+ lib_opac => undef, >+ imageurl => '', >+ }, >+ { >+ id => ignore(), >+ category => 'BUG10656', >+ authorised_value => 'ZZZ', >+ selected => 0, >+ lib => 'Z_STAFF', >+ lib_opac => 'A_PUBLIC', >+ imageurl => '', >+ }, >+ ], >+ 'list of authorised values in staff mode sorted by staff label (bug 10656)' >+ ); >+ $authvals = GetAuthorisedValues('BUG10656', '', 1); >+ cmp_deeply( >+ $authvals, >+ [ >+ { >+ id => ignore(), >+ category => 'BUG10656', >+ authorised_value => 'ZZZ', >+ selected => 0, >+ lib => 'A_PUBLIC', >+ lib_opac => 'A_PUBLIC', >+ imageurl => '', >+ }, >+ { >+ id => ignore(), >+ category => 'BUG10656', >+ authorised_value => 'DDD', >+ selected => 0, >+ lib => 'D_STAFF', >+ lib_opac => undef, >+ imageurl => '', >+ }, >+ { >+ id => ignore(), >+ category => 'BUG10656', >+ authorised_value => 'AAA', >+ selected => 0, >+ lib => 'Z_PUBLIC', >+ lib_opac => 'Z_PUBLIC', >+ imageurl => '', >+ }, >+ ], >+ 'list of authorised values in OPAC mode sorted by OPAC label (bug 10656)' >+ ); >+ } >+ > }; > > subtest 'Itemtype info Tests' => sub { >@@ -85,6 +164,7 @@ subtest 'Itemtype info Tests' => sub { > ### test for C4::Koha->GetDailyQuote() > SKIP: > { >+ eval { require Test::Deep; import Test::Deep; }; > skip "Test::Deep required to run the GetDailyQuote tests.", 1 if $@; > > subtest 'Daily Quotes Test' => sub { >-- >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 10656
:
19978
|
19979
|
20039
|
20040
|
20502
|
20507
|
20508
|
20509
|
20512
|
20513
|
20514
| 20825 |
20826
|
20827